Blame SOURCES/gdb-rhbz795424-bitpos-25of25-test.patch

4c2ad1
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
4c2ad1
From: Fedora GDB patches <invalid@email.com>
4c2ad1
Date: Fri, 27 Oct 2017 21:07:50 +0200
4c2ad1
Subject: gdb-rhbz795424-bitpos-25of25-test.patch
4c2ad1
4c2ad1
;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
4c2ad1
;; (RH BZ 795424).
4c2ad1
;;=push
4c2ad1
4c2ad1
http://sourceware.org/ml/gdb-patches/2012-10/msg00231.html
4c2ad1
4c2ad1
On Mon, 15 Oct 2012 15:25:55 +0200, Jan Kratochvil wrote:
4c2ad1
> I have filed for it now:
4c2ad1
> 	Invalid debug/ array bounds w/-fno-range-check and 32-bit target
4c2ad1
> 	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54934
4c2ad1
4c2ad1
Therefore it looks as a valid gfortran FSF GCC HEAD bug so provided
4c2ad1
a hand-patched .S file for i386; patched GDB PASSes with it.
4c2ad1
4c2ad1
Thanks,
4c2ad1
Jan
4c2ad1
4c2ad1
2012-10-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
4c2ad1
	    Jan Kratochvil  <jan.kratochvil@redhat.com>
4c2ad1
4c2ad1
	* gdb.fortran/array-bounds.exp: New test file.
4c2ad1
	* gdb.fortran/array-bounds.f: New test file.
4c2ad1
	* gdb.fortran/array-bounds.S: New test file.
4c2ad1
4c2ad1
diff --git a/gdb/testsuite/gdb.fortran/array-bounds.S b/gdb/testsuite/gdb.fortran/array-bounds.S
4c2ad1
new file mode 100644
4c2ad1
--- /dev/null
4c2ad1
+++ b/gdb/testsuite/gdb.fortran/array-bounds.S
4c2ad1
@@ -0,0 +1,529 @@
4c2ad1
+/* Copyright 2012 Free Software Foundation, Inc.
4c2ad1
+
4c2ad1
+   This program is free software; you can redistribute it and/or modify
4c2ad1
+   it under the terms of the GNU General Public License as published by
4c2ad1
+   the Free Software Foundation; either version 3 of the License, or
4c2ad1
+   (at your option) any later version.
4c2ad1
+
4c2ad1
+   This program is distributed in the hope that it will be useful,
4c2ad1
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4c2ad1
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c2ad1
+   GNU General Public License for more details.
4c2ad1
+
4c2ad1
+   You should have received a copy of the GNU General Public License
4c2ad1
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
4c2ad1
+
4c2ad1
+   This file is part of the gdb testsuite.  */
4c2ad1
+
4c2ad1
+	.file	"array-bounds.f"
4c2ad1
+	.text
4c2ad1
+.Ltext0:
4c2ad1
+	.type	MAIN__, @function
4c2ad1
+MAIN__:
4c2ad1
+.LFB0:
4c2ad1
+	.file 1 "gdb.fortran/array-bounds.f"
4c2ad1
+	# gdb.fortran/array-bounds.f:16
4c2ad1
+	.loc 1 16 0
4c2ad1
+	.cfi_startproc
4c2ad1
+# BLOCK 2 seq:0
4c2ad1
+# PRED: ENTRY (FALLTHRU)
4c2ad1
+	pushl	%ebp
4c2ad1
+.LCFI0:
4c2ad1
+	.cfi_def_cfa_offset 8
4c2ad1
+	.cfi_offset 5, -8
4c2ad1
+	movl	%esp, %ebp
4c2ad1
+.LCFI1:
4c2ad1
+	.cfi_def_cfa_register 5
4c2ad1
+	subl	$40, %esp
4c2ad1
+.LBB2:
4c2ad1
+# SUCC: 3 (FALLTHRU)
4c2ad1
+	# gdb.fortran/array-bounds.f:18
4c2ad1
+	.loc 1 18 0
4c2ad1
+	movl	$-1, %eax
4c2ad1
+# BLOCK 3 seq:1
4c2ad1
+# PRED: 2 (FALLTHRU) 4 [100.0%] 
4c2ad1
+.L3:
4c2ad1
+	# gdb.fortran/array-bounds.f:18
4c2ad1
+	.loc 1 18 0 is_stmt 0 discriminator 1
4c2ad1
+	testl	%eax, %eax
4c2ad1
+# SUCC: 5 4 (FALLTHRU)
4c2ad1
+	jg	.L2
4c2ad1
+# BLOCK 4 seq:2
4c2ad1
+# PRED: 3 (FALLTHRU)
4c2ad1
+	# gdb.fortran/array-bounds.f:18
4c2ad1
+	.loc 1 18 0 discriminator 2
4c2ad1
+	leal	1(%eax), %ecx
4c2ad1
+	movl	.LC0, %edx
4c2ad1
+	movl	%edx, -16(%ebp,%ecx,4)
4c2ad1
+	addl	$1, %eax
4c2ad1
+# SUCC: 3 [100.0%] 
4c2ad1
+	jmp	.L3
4c2ad1
+# BLOCK 5 seq:3
4c2ad1
+# PRED: 3
4c2ad1
+.L2:
4c2ad1
+.LBE2:
4c2ad1
+	# gdb.fortran/array-bounds.f:19
4c2ad1
+	.loc 1 19 0 is_stmt 1
4c2ad1
+	movl	-16(%ebp), %eax
4c2ad1
+	movl	-12(%ebp), %edx
4c2ad1
+	movl	%eax, -24(%ebp)
4c2ad1
+	movl	%edx, -20(%ebp)
4c2ad1
+	# gdb.fortran/array-bounds.f:20
4c2ad1
+	.loc 1 20 0
4c2ad1
+	movl	$0, 4(%esp)
4c2ad1
+	movl	$0, (%esp)
4c2ad1
+# SUCC:
4c2ad1
+	call	_gfortran_stop_string
4c2ad1
+	.cfi_endproc
4c2ad1
+.LFE0:
4c2ad1
+	.size	MAIN__, .-MAIN__
4c2ad1
+	.globl	main
4c2ad1
+	.type	main, @function
4c2ad1
+main:
4c2ad1
+.LFB1:
4c2ad1
+	# gdb.fortran/array-bounds.f:21
4c2ad1
+	.loc 1 21 0
4c2ad1
+	.cfi_startproc
4c2ad1
+# BLOCK 2 seq:0
4c2ad1
+# PRED: ENTRY (FALLTHRU)
4c2ad1
+	pushl	%ebp
4c2ad1
+.LCFI2:
4c2ad1
+	.cfi_def_cfa_offset 8
4c2ad1
+	.cfi_offset 5, -8
4c2ad1
+	movl	%esp, %ebp
4c2ad1
+.LCFI3:
4c2ad1
+	.cfi_def_cfa_register 5
4c2ad1
+	andl	$-16, %esp
4c2ad1
+	subl	$16, %esp
4c2ad1
+	# gdb.fortran/array-bounds.f:21
4c2ad1
+	.loc 1 21 0
4c2ad1
+	movl	12(%ebp), %eax
4c2ad1
+	movl	%eax, 4(%esp)
4c2ad1
+	movl	8(%ebp), %eax
4c2ad1
+	movl	%eax, (%esp)
4c2ad1
+	call	_gfortran_set_args
4c2ad1
+	movl	$options.1.1824, 4(%esp)
4c2ad1
+	movl	$7, (%esp)
4c2ad1
+	call	_gfortran_set_options
4c2ad1
+	call	MAIN__
4c2ad1
+	movl	$0, %eax
4c2ad1
+	leave
4c2ad1
+.LCFI4:
4c2ad1
+	.cfi_restore 5
4c2ad1
+	.cfi_def_cfa 4, 4
4c2ad1
+# SUCC: EXIT [100.0%] 
4c2ad1
+	ret
4c2ad1
+	.cfi_endproc
4c2ad1
+.LFE1:
4c2ad1
+	.size	main, .-main
4c2ad1
+	.section	.rodata
4c2ad1
+	.align 4
4c2ad1
+	.type	options.1.1824, @object
4c2ad1
+	.size	options.1.1824, 28
4c2ad1
+options.1.1824:
4c2ad1
+	.long	68
4c2ad1
+	.long	1023
4c2ad1
+	.long	0
4c2ad1
+	.long	0
4c2ad1
+	.long	1
4c2ad1
+	.long	1
4c2ad1
+	.long	0
4c2ad1
+	.align 4
4c2ad1
+.LC0:
4c2ad1
+	.long	1109917696
4c2ad1
+	.text
4c2ad1
+.Letext0:
4c2ad1
+	.section	.debug_info,"",@progbits
4c2ad1
+.Ldebug_info0:
4c2ad1
+	.long	2f - 1f	# Length of Compilation Unit Info
4c2ad1
+1:
4c2ad1
+	.value	0x2	# DWARF version number
4c2ad1
+	.long	.Ldebug_abbrev0	# Offset Into Abbrev. Section
4c2ad1
+	.byte	0x4	# Pointer Size (in bytes)
4c2ad1
+dieb:	.uleb128 0x1	# (DIE (0xb) DW_TAG_compile_unit)
4c2ad1
+	.long	.LASF5	# DW_AT_producer: "GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude"
4c2ad1
+	.byte	0xe	# DW_AT_language
4c2ad1
+	.byte	0x2	# DW_AT_identifier_case
4c2ad1
+	.long	.LASF6	# DW_AT_name: "gdb.fortran/array-bounds.f"
4c2ad1
+	.long	.LASF7	# DW_AT_comp_dir: ""
4c2ad1
+	.long	.Ltext0	# DW_AT_low_pc
4c2ad1
+	.long	.Letext0	# DW_AT_high_pc
4c2ad1
+	.long	.Ldebug_line0	# DW_AT_stmt_list
4c2ad1
+die26:	.uleb128 0x2	# (DIE (0x26) DW_TAG_subprogram)
4c2ad1
+	.long	.LASF8	# DW_AT_name: "MAIN__"
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x10	# DW_AT_decl_line
4c2ad1
+	.long	.LFB0	# DW_AT_low_pc
4c2ad1
+	.long	.LFE0	# DW_AT_high_pc
4c2ad1
+	.long	.LLST0	# DW_AT_frame_base
4c2ad1
+	.byte	0x1	# DW_AT_GNU_all_tail_call_sites
4c2ad1
+	.byte	0x1	# DW_AT_main_subprogram
4c2ad1
+	.byte	0x2	# DW_AT_calling_convention
4c2ad1
+	.long	die66 - .Ldebug_info0	# DW_AT_sibling
4c2ad1
+die40:	.uleb128 0x3	# (DIE (0x40) DW_TAG_variable)
4c2ad1
+	.ascii "bar\0"	# DW_AT_name
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x11	# DW_AT_decl_line
4c2ad1
+	.long	die66 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.byte	0x2	# DW_AT_location
4c2ad1
+	.byte	0x91	# DW_OP_fbreg
4c2ad1
+	.sleb128 -24
4c2ad1
+die4e:	.uleb128 0x3	# (DIE (0x4e) DW_TAG_variable)
4c2ad1
+	.ascii "foo\0"	# DW_AT_name
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x10	# DW_AT_decl_line
4c2ad1
+	.long	die88 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.byte	0x2	# DW_AT_location
4c2ad1
+	.byte	0x91	# DW_OP_fbreg
4c2ad1
+	.sleb128 -32
4c2ad1
+die5c:	.uleb128 0x4	# (DIE (0x5c) DW_TAG_lexical_block)
4c2ad1
+	.long	.LBB2	# DW_AT_low_pc
4c2ad1
+	.long	.LBE2	# DW_AT_high_pc
4c2ad1
+	.byte	0	# end of children of DIE 0x26
4c2ad1
+die66:	.uleb128 0x5	# (DIE (0x66) DW_TAG_array_type)
4c2ad1
+	.long	die81 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.long	die7a - .Ldebug_info0	# DW_AT_sibling
4c2ad1
+die6f:	.uleb128 0x6	# (DIE (0x6f) DW_TAG_subrange_type)
4c2ad1
+	.long	die7a - .Ldebug_info0	# DW_AT_type
4c2ad1
+#if 0
4c2ad1
+	.long	0xffffffff	# DW_AT_lower_bound
4c2ad1
+	.byte	0	# DW_AT_upper_bound
4c2ad1
+#else
4c2ad1
+	.quad	0xfffffffeffffffff	# DW_AT_lower_bound
4c2ad1
+	.quad	0xffffffff00000000	# DW_AT_upper_bound
4c2ad1
+#endif
4c2ad1
+	.byte	0	# end of children of DIE 0x66
4c2ad1
+die7a:	.uleb128 0x7	# (DIE (0x7a) DW_TAG_base_type)
4c2ad1
+#if 0
4c2ad1
+	.byte	0x4	# DW_AT_byte_size
4c2ad1
+#else
4c2ad1
+	.byte	0x8	# DW_AT_byte_size
4c2ad1
+#endif
4c2ad1
+	.byte	0x5	# DW_AT_encoding
4c2ad1
+	.long	.LASF0	# DW_AT_name: "integer(kind=4)"
4c2ad1
+die81:	.uleb128 0x7	# (DIE (0x81) DW_TAG_base_type)
4c2ad1
+	.byte	0x4	# DW_AT_byte_size
4c2ad1
+	.byte	0x4	# DW_AT_encoding
4c2ad1
+	.long	.LASF1	# DW_AT_name: "real(kind=4)"
4c2ad1
+die88:	.uleb128 0x5	# (DIE (0x88) DW_TAG_array_type)
4c2ad1
+	.long	die81 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.long	die99 - .Ldebug_info0	# DW_AT_sibling
4c2ad1
+die91:	.uleb128 0x8	# (DIE (0x91) DW_TAG_subrange_type)
4c2ad1
+	.long	die7a - .Ldebug_info0	# DW_AT_type
4c2ad1
+#if 0
4c2ad1
+	.byte	0	# DW_AT_lower_bound
4c2ad1
+	.byte	0x1	# DW_AT_upper_bound
4c2ad1
+#else
4c2ad1
+	.quad	0x100000000	# DW_AT_lower_bound
4c2ad1
+	.quad	0x100000001	# DW_AT_upper_bound
4c2ad1
+#endif
4c2ad1
+	.byte	0	# end of children of DIE 0x88
4c2ad1
+die99:	.uleb128 0x9	# (DIE (0x99) DW_TAG_subprogram)
4c2ad1
+	.byte	0x1	# DW_AT_external
4c2ad1
+	.long	.LASF9	# DW_AT_name: "main"
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x15	# DW_AT_decl_line
4c2ad1
+	.long	die7a - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.long	.LFB1	# DW_AT_low_pc
4c2ad1
+	.long	.LFE1	# DW_AT_high_pc
4c2ad1
+	.long	.LLST1	# DW_AT_frame_base
4c2ad1
+	.byte	0x1	# DW_AT_GNU_all_tail_call_sites
4c2ad1
+	.long	died4 - .Ldebug_info0	# DW_AT_sibling
4c2ad1
+dieb6:	.uleb128 0xa	# (DIE (0xb6) DW_TAG_formal_parameter)
4c2ad1
+	.long	.LASF2	# DW_AT_name: "argc"
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x15	# DW_AT_decl_line
4c2ad1
+	.long	died4 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.byte	0x2	# DW_AT_location
4c2ad1
+	.byte	0x91	# DW_OP_fbreg
4c2ad1
+	.sleb128 0
4c2ad1
+diec4:	.uleb128 0xa	# (DIE (0xc4) DW_TAG_formal_parameter)
4c2ad1
+	.long	.LASF3	# DW_AT_name: "argv"
4c2ad1
+	.byte	0x1	# DW_AT_decl_file (gdb.fortran/array-bounds.f)
4c2ad1
+	.byte	0x15	# DW_AT_decl_line
4c2ad1
+	.long	died9 - .Ldebug_info0	# DW_AT_type
4c2ad1
+	.byte	0x3	# DW_AT_location
4c2ad1
+	.byte	0x91	# DW_OP_fbreg
4c2ad1
+	.sleb128 4
4c2ad1
+	.byte	0x6	# DW_OP_deref
4c2ad1
+	.byte	0	# end of children of DIE 0x99
4c2ad1
+died4:	.uleb128 0xb	# (DIE (0xd4) DW_TAG_const_type)
4c2ad1
+	.long	die7a - .Ldebug_info0	# DW_AT_type
4c2ad1
+died9:	.uleb128 0xc	# (DIE (0xd9) DW_TAG_pointer_type)
4c2ad1
+	.byte	0x4	# DW_AT_byte_size
4c2ad1
+	.long	diedf - .Ldebug_info0	# DW_AT_type
4c2ad1
+diedf:	.uleb128 0x7	# (DIE (0xdf) DW_TAG_base_type)
4c2ad1
+	.byte	0x1	# DW_AT_byte_size
4c2ad1
+	.byte	0x8	# DW_AT_encoding
4c2ad1
+	.long	.LASF4	# DW_AT_name: "character(kind=1)"
4c2ad1
+	.byte	0	# end of children of DIE 0xb
4c2ad1
+2:
4c2ad1
+	.section	.debug_abbrev,"",@progbits
4c2ad1
+.Ldebug_abbrev0:
4c2ad1
+	.uleb128 0x1	# (abbrev code)
4c2ad1
+	.uleb128 0x11	# (TAG: DW_TAG_compile_unit)
4c2ad1
+	.byte	0x1	# DW_children_yes
4c2ad1
+	.uleb128 0x25	# (DW_AT_producer)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x13	# (DW_AT_language)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x42	# (DW_AT_identifier_case)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x1b	# (DW_AT_comp_dir)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x11	# (DW_AT_low_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x12	# (DW_AT_high_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x10	# (DW_AT_stmt_list)
4c2ad1
+	.uleb128 0x6	# (DW_FORM_data4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x2	# (abbrev code)
4c2ad1
+	.uleb128 0x2e	# (TAG: DW_TAG_subprogram)
4c2ad1
+	.byte	0x1	# DW_children_yes
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x3a	# (DW_AT_decl_file)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3b	# (DW_AT_decl_line)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x11	# (DW_AT_low_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x12	# (DW_AT_high_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x40	# (DW_AT_frame_base)
4c2ad1
+	.uleb128 0x6	# (DW_FORM_data4)
4c2ad1
+	.uleb128 0x2116	# (DW_AT_GNU_all_tail_call_sites)
4c2ad1
+	.uleb128 0xc	# (DW_FORM_flag)
4c2ad1
+	.uleb128 0x6a	# (DW_AT_main_subprogram)
4c2ad1
+	.uleb128 0xc	# (DW_FORM_flag)
4c2ad1
+	.uleb128 0x36	# (DW_AT_calling_convention)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x1	# (DW_AT_sibling)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x3	# (abbrev code)
4c2ad1
+	.uleb128 0x34	# (TAG: DW_TAG_variable)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0x8	# (DW_FORM_string)
4c2ad1
+	.uleb128 0x3a	# (DW_AT_decl_file)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3b	# (DW_AT_decl_line)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.uleb128 0x2	# (DW_AT_location)
4c2ad1
+	.uleb128 0xa	# (DW_FORM_block1)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x4	# (abbrev code)
4c2ad1
+	.uleb128 0xb	# (TAG: DW_TAG_lexical_block)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x11	# (DW_AT_low_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x12	# (DW_AT_high_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x5	# (abbrev code)
4c2ad1
+	.uleb128 0x1	# (TAG: DW_TAG_array_type)
4c2ad1
+	.byte	0x1	# DW_children_yes
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.uleb128 0x1	# (DW_AT_sibling)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x6	# (abbrev code)
4c2ad1
+	.uleb128 0x21	# (TAG: DW_TAG_subrange_type)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+#if 0
4c2ad1
+	.uleb128 0x22	# (DW_AT_lower_bound)
4c2ad1
+	.uleb128 0x6	# (DW_FORM_data4)
4c2ad1
+	.uleb128 0x2f	# (DW_AT_upper_bound)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+#else
4c2ad1
+	.uleb128 0x22	# (DW_AT_lower_bound)
4c2ad1
+	.uleb128 0x7	# (DW_FORM_data8)
4c2ad1
+	.uleb128 0x2f	# (DW_AT_upper_bound)
4c2ad1
+	.uleb128 0x7	# (DW_FORM_data8)
4c2ad1
+#endif
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x7	# (abbrev code)
4c2ad1
+	.uleb128 0x24	# (TAG: DW_TAG_base_type)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0xb	# (DW_AT_byte_size)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3e	# (DW_AT_encoding)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x8	# (abbrev code)
4c2ad1
+	.uleb128 0x21	# (TAG: DW_TAG_subrange_type)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+#if 0
4c2ad1
+	.uleb128 0x22	# (DW_AT_lower_bound)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x2f	# (DW_AT_upper_bound)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+#else
4c2ad1
+	.uleb128 0x22	# (DW_AT_lower_bound)
4c2ad1
+	.uleb128 0x7	# (DW_FORM_data8)
4c2ad1
+	.uleb128 0x2f	# (DW_AT_upper_bound)
4c2ad1
+	.uleb128 0x7	# (DW_FORM_data8)
4c2ad1
+#endif
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0x9	# (abbrev code)
4c2ad1
+	.uleb128 0x2e	# (TAG: DW_TAG_subprogram)
4c2ad1
+	.byte	0x1	# DW_children_yes
4c2ad1
+	.uleb128 0x3f	# (DW_AT_external)
4c2ad1
+	.uleb128 0xc	# (DW_FORM_flag)
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x3a	# (DW_AT_decl_file)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3b	# (DW_AT_decl_line)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.uleb128 0x11	# (DW_AT_low_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x12	# (DW_AT_high_pc)
4c2ad1
+	.uleb128 0x1	# (DW_FORM_addr)
4c2ad1
+	.uleb128 0x40	# (DW_AT_frame_base)
4c2ad1
+	.uleb128 0x6	# (DW_FORM_data4)
4c2ad1
+	.uleb128 0x2116	# (DW_AT_GNU_all_tail_call_sites)
4c2ad1
+	.uleb128 0xc	# (DW_FORM_flag)
4c2ad1
+	.uleb128 0x1	# (DW_AT_sibling)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0xa	# (abbrev code)
4c2ad1
+	.uleb128 0x5	# (TAG: DW_TAG_formal_parameter)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x3	# (DW_AT_name)
4c2ad1
+	.uleb128 0xe	# (DW_FORM_strp)
4c2ad1
+	.uleb128 0x3a	# (DW_AT_decl_file)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x3b	# (DW_AT_decl_line)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.uleb128 0x2	# (DW_AT_location)
4c2ad1
+	.uleb128 0xa	# (DW_FORM_block1)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0xb	# (abbrev code)
4c2ad1
+	.uleb128 0x26	# (TAG: DW_TAG_const_type)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.uleb128 0xc	# (abbrev code)
4c2ad1
+	.uleb128 0xf	# (TAG: DW_TAG_pointer_type)
4c2ad1
+	.byte	0	# DW_children_no
4c2ad1
+	.uleb128 0xb	# (DW_AT_byte_size)
4c2ad1
+	.uleb128 0xb	# (DW_FORM_data1)
4c2ad1
+	.uleb128 0x49	# (DW_AT_type)
4c2ad1
+	.uleb128 0x13	# (DW_FORM_ref4)
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.byte	0
4c2ad1
+	.section	.debug_loc,"",@progbits
4c2ad1
+.Ldebug_loc0:
4c2ad1
+.LLST0:
4c2ad1
+	.long	.LFB0-.Ltext0	# Location list begin address (*.LLST0)
4c2ad1
+	.long	.LCFI0-.Ltext0	# Location list end address (*.LLST0)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x74	# DW_OP_breg4
4c2ad1
+	.sleb128 4
4c2ad1
+	.long	.LCFI0-.Ltext0	# Location list begin address (*.LLST0)
4c2ad1
+	.long	.LCFI1-.Ltext0	# Location list end address (*.LLST0)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x74	# DW_OP_breg4
4c2ad1
+	.sleb128 8
4c2ad1
+	.long	.LCFI1-.Ltext0	# Location list begin address (*.LLST0)
4c2ad1
+	.long	.LFE0-.Ltext0	# Location list end address (*.LLST0)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x75	# DW_OP_breg5
4c2ad1
+	.sleb128 8
4c2ad1
+	.long	0	# Location list terminator begin (*.LLST0)
4c2ad1
+	.long	0	# Location list terminator end (*.LLST0)
4c2ad1
+.LLST1:
4c2ad1
+	.long	.LFB1-.Ltext0	# Location list begin address (*.LLST1)
4c2ad1
+	.long	.LCFI2-.Ltext0	# Location list end address (*.LLST1)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x74	# DW_OP_breg4
4c2ad1
+	.sleb128 4
4c2ad1
+	.long	.LCFI2-.Ltext0	# Location list begin address (*.LLST1)
4c2ad1
+	.long	.LCFI3-.Ltext0	# Location list end address (*.LLST1)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x74	# DW_OP_breg4
4c2ad1
+	.sleb128 8
4c2ad1
+	.long	.LCFI3-.Ltext0	# Location list begin address (*.LLST1)
4c2ad1
+	.long	.LCFI4-.Ltext0	# Location list end address (*.LLST1)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x75	# DW_OP_breg5
4c2ad1
+	.sleb128 8
4c2ad1
+	.long	.LCFI4-.Ltext0	# Location list begin address (*.LLST1)
4c2ad1
+	.long	.LFE1-.Ltext0	# Location list end address (*.LLST1)
4c2ad1
+	.value	0x2	# Location expression size
4c2ad1
+	.byte	0x74	# DW_OP_breg4
4c2ad1
+	.sleb128 4
4c2ad1
+	.long	0	# Location list terminator begin (*.LLST1)
4c2ad1
+	.long	0	# Location list terminator end (*.LLST1)
4c2ad1
+	.section	.debug_aranges,"",@progbits
4c2ad1
+	.long	0x1c	# Length of Address Ranges Info
4c2ad1
+	.value	0x2	# DWARF Version
4c2ad1
+	.long	.Ldebug_info0	# Offset of Compilation Unit Info
4c2ad1
+	.byte	0x4	# Size of Address
4c2ad1
+	.byte	0	# Size of Segment Descriptor
4c2ad1
+	.value	0	# Pad to 8 byte boundary
4c2ad1
+	.value	0
4c2ad1
+	.long	.Ltext0	# Address
4c2ad1
+	.long	.Letext0-.Ltext0	# Length
4c2ad1
+	.long	0
4c2ad1
+	.long	0
4c2ad1
+	.section	.debug_line,"",@progbits
4c2ad1
+.Ldebug_line0:
4c2ad1
+	.section	.debug_str,"MS",@progbits,1
4c2ad1
+.LASF4:
4c2ad1
+	.string	"character(kind=1)"
4c2ad1
+.LASF5:
4c2ad1
+	.string	"GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude"
4c2ad1
+.LASF7:
4c2ad1
+	.string	""
4c2ad1
+.LASF0:
4c2ad1
+#if 0
4c2ad1
+	.string	"integer(kind=4)"
4c2ad1
+#else
4c2ad1
+	.string	"integer(kind=8)"
4c2ad1
+#endif
4c2ad1
+.LASF9:
4c2ad1
+	.string	"main"
4c2ad1
+.LASF8:
4c2ad1
+	.string	"MAIN__"
4c2ad1
+.LASF6:
4c2ad1
+	.string	"gdb.fortran/array-bounds.f"
4c2ad1
+.LASF2:
4c2ad1
+	.string	"argc"
4c2ad1
+.LASF1:
4c2ad1
+	.string	"real(kind=4)"
4c2ad1
+.LASF3:
4c2ad1
+	.string	"argv"
4c2ad1
+	.ident	"GCC: (GNU) 4.8.0 20121015 (experimental)"
4c2ad1
+	.section	.note.GNU-stack,"",@progbits
4c2ad1
diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp
4c2ad1
new file mode 100644
4c2ad1
--- /dev/null
4c2ad1
+++ b/gdb/testsuite/gdb.fortran/array-bounds.exp
4c2ad1
@@ -0,0 +1,43 @@
4c2ad1
+# Copyright 2012 Free Software Foundation, Inc.
4c2ad1
+
4c2ad1
+# This program is free software; you can redistribute it and/or modify
4c2ad1
+# it under the terms of the GNU General Public License as published by
4c2ad1
+# the Free Software Foundation; either version 3 of the License, or
4c2ad1
+# (at your option) any later version.
4c2ad1
+#
4c2ad1
+# This program is distributed in the hope that it will be useful,
4c2ad1
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c2ad1
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c2ad1
+# GNU General Public License for more details.
4c2ad1
+#
4c2ad1
+# You should have received a copy of the GNU General Public License
4c2ad1
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
4c2ad1
+
4c2ad1
+# This file is part of the gdb testsuite.  It contains test to ensure that
4c2ad1
+# array bounds accept LONGEST.
4c2ad1
+
4c2ad1
+if { [skip_fortran_tests] } { return -1 }
4c2ad1
+
4c2ad1
+set testfile "array-bounds"
4c2ad1
+
4c2ad1
+if { [is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"]
4c2ad1
+			   || [istarget "x86_64-*-linux*"]) } {
4c2ad1
+    set srcfile ${testfile}.S
4c2ad1
+    set opts {nodebug f90}
4c2ad1
+} else {
4c2ad1
+    set srcfile ${testfile}.f
4c2ad1
+    set opts {debug f90}
4c2ad1
+}
4c2ad1
+
4c2ad1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile $opts]} {
4c2ad1
+    print "compile failed"
4c2ad1
+    return -1
4c2ad1
+}
4c2ad1
+
4c2ad1
+if { ![runto MAIN__] } {
4c2ad1
+    perror "Could not run to breakpoint `MAIN__'."
4c2ad1
+    continue
4c2ad1
+}
4c2ad1
+
4c2ad1
+gdb_test "print &foo" {.*\(4294967296:4294967297\).*}
4c2ad1
+gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*}
4c2ad1
diff --git a/gdb/testsuite/gdb.fortran/array-bounds.f b/gdb/testsuite/gdb.fortran/array-bounds.f
4c2ad1
new file mode 100644
4c2ad1
--- /dev/null
4c2ad1
+++ b/gdb/testsuite/gdb.fortran/array-bounds.f
4c2ad1
@@ -0,0 +1,22 @@
4c2ad1
+c Copyright 2012 Free Software Foundation, Inc.
4c2ad1
+
4c2ad1
+c This program is free software; you can redistribute it and/or modify
4c2ad1
+c it under the terms of the GNU General Public License as published by
4c2ad1
+c the Free Software Foundation; either version 3 of the License, or
4c2ad1
+c (at your option) any later version.
4c2ad1
+c
4c2ad1
+c This program is distributed in the hope that it will be useful,
4c2ad1
+c but WITHOUT ANY WARRANTY; without even the implied warranty of
4c2ad1
+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c2ad1
+c GNU General Public License for more details.
4c2ad1
+c
4c2ad1
+c You should have received a copy of the GNU General Public License
4c2ad1
+c along with this program.  If not, see <http://www.gnu.org/licenses/>.
4c2ad1
+
4c2ad1
+        dimension foo(4294967296_8:4294967297_8)
4c2ad1
+        dimension bar(-4294967297_8:-4294967296_8)
4c2ad1
+        bar = 42
4c2ad1
+        foo=bar
4c2ad1
+        stop
4c2ad1
+        end
4c2ad1
+