public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862
@ 2009-11-20 15:13 nvab at ibrae dot ac dot ru
2009-11-20 15:34 ` [Bug middle-end/42119] " rguenth at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: nvab at ibrae dot ac dot ru @ 2009-11-20 15:13 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2698 bytes --]
Test file (Test.f90):
-------------------------------------
module Test
use ISO_C_BINDING
contains
subroutine Callback(arg) bind(C)
integer(C_INT) :: arg
end subroutine Callback
subroutine Check(proc)
type(C_FUNPTR) :: proc
end subroutine Check
end module Test
program Main
use Test
type(C_FUNPTR) :: proc
call Check(C_FUNLOC(Callback))
! This works fine:
! proc = C_FUNLOC(Callback)
! call Check(proc)
end program Main
-------------------------------------
Compiler output:
-------------------------------------
smile@ubuntu:~/Code$ gfortran -v Test.f90
Driving: gfortran -v Test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu8'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror
--with-arch-32=i486 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic'
/usr/lib/gcc/x86_64-linux-gnu/4.4.1/f951 Test.f90 -quiet -dumpbase Test.f90
-mtune=generic -auxbase Test -version -fintrinsic-modules-path
/usr/lib/gcc/x86_64-linux-gnu/4.4.1/finclude -o /tmp/ccn1uZ8e.s
GNU Fortran (Ubuntu 4.4.1-4ubuntu8) version 4.4.1 (x86_64-linux-gnu)
compiled by GNU C version 4.4.1, GMP version 4.3.1, MPFR version
2.4.1-p2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Test.f90: In function main:
Test.f90:21: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:6862
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
--
Summary: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:6862
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nvab at ibrae dot ac dot ru
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42119
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/42119] internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862
2009-11-20 15:13 [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862 nvab at ibrae dot ac dot ru
@ 2009-11-20 15:34 ` rguenth at gcc dot gnu dot org
2009-11-20 18:00 ` mikael at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-20 15:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-11-20 15:33 -------
Confirmed. Sth as simple as
Index: gcc/expr.c
===================================================================
--- gcc/expr.c (revision 154364)
+++ gcc/expr.c (working copy)
@@ -6834,7 +6834,8 @@ expand_expr_addr_expr_1 (tree exp, rtx t
/* ??? This should be considered a front-end bug. We should not be
generating ADDR_EXPR of something that isn't an LVALUE. The only
exception here is STRING_CST. */
- if (CONSTANT_CLASS_P (exp))
+ if (CONSTANT_CLASS_P (exp)
+ || (TREE_CODE (exp) == ADDR_EXPR && TREE_CONSTANT (exp)))
return XEXP (expand_expr_constant (exp, 0, modifier), 0);
/* Everything must be something allowed by is_gimple_addressable. */
might fix it, though the recursion in this function for CONST_DECLs
make it a bit convoluted to call it obvious.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|fortran |middle-end
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Known to fail| |4.5.0
Last reconfirmed|0000-00-00 00:00:00 |2009-11-20 15:33:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42119
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/42119] internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862
2009-11-20 15:13 [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862 nvab at ibrae dot ac dot ru
2009-11-20 15:34 ` [Bug middle-end/42119] " rguenth at gcc dot gnu dot org
@ 2009-11-20 18:00 ` mikael at gcc dot gnu dot org
2009-11-20 18:06 ` pinskia at gcc dot gnu dot org
2009-11-30 10:40 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: mikael at gcc dot gnu dot org @ 2009-11-20 18:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from mikael at gcc dot gnu dot org 2009-11-20 17:59 -------
This is the same as PR 38530
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42119
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/42119] internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862
2009-11-20 15:13 [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862 nvab at ibrae dot ac dot ru
2009-11-20 15:34 ` [Bug middle-end/42119] " rguenth at gcc dot gnu dot org
2009-11-20 18:00 ` mikael at gcc dot gnu dot org
@ 2009-11-20 18:06 ` pinskia at gcc dot gnu dot org
2009-11-30 10:40 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-20 18:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2009-11-20 18:05 -------
*** This bug has been marked as a duplicate of 38530 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42119
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/42119] internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862
2009-11-20 15:13 [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862 nvab at ibrae dot ac dot ru
` (2 preceding siblings ...)
2009-11-20 18:06 ` pinskia at gcc dot gnu dot org
@ 2009-11-30 10:40 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-30 10:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-11-30 10:39 -------
Subject: Bug 42119
Author: rguenth
Date: Mon Nov 30 10:39:36 2009
New Revision: 154778
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154778
Log:
2009-11-30 Richard Guenther <rguenther@suse.de>
PR middle-end/42119
PR fortran/38530
* expr.c (expand_expr_addr_expr_1): Properly expand the initializer
of CONST_DECLs.
* gfortran.dg/pr42119.f90: New testcase.
Added:
trunk/gcc/testsuite/gfortran.dg/pr42119.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42119
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-30 10:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-20 15:13 [Bug fortran/42119] New: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6862 nvab at ibrae dot ac dot ru
2009-11-20 15:34 ` [Bug middle-end/42119] " rguenth at gcc dot gnu dot org
2009-11-20 18:00 ` mikael at gcc dot gnu dot org
2009-11-20 18:06 ` pinskia at gcc dot gnu dot org
2009-11-30 10:40 ` rguenth at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).