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

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