public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835
@ 2011-04-05 19:41 gcc.ourteddybear at xoxy dot net
  2011-04-05 22:30 ` [Bug c/48470] " mikpe at it dot uu.se
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gcc.ourteddybear at xoxy dot net @ 2011-04-05 19:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

           Summary: ICE in expand_expr_addr_expr_1 at expr.c:6835
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gcc.ourteddybear@xoxy.net


Created attachment 23886
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23886
Proprocessed source (built with -E, since -save-temps is an unrecognized
option)

Version (output from --version, since -v is apparently a verbose flag, not a
version flag):

GNU C (GCC) version 4.4.5 (arm-unknown-elf)
        compiled by GNU C version 3.4.4 (mingw special), GMP version 4.3.2,
MPFR
 version 2.4.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072


Command line:

"C:/Program Files/Rowley Associates Limited/CrossWorks for ARM 2.0/gcc/bin/cc1"
-fmessage-length=0 -mcpu=arm7tdmi -mthumb-interwork -mlittle-endian -mfpu=vfp
-mfloat-abi=soft -nostdinc "-isystemC:/Program Files/Rowley Associates
Limited/CrossWorks for ARM 2.0/include" "-isystemC:/Documents and
Settings/sacleary/Local Settings/Application Data/Rowley Associates
Limited/CrossWorks for ARM/packages/include" "-IC:/Code/v2/LN-200
IMU/../Components/include/FreeRTOS" "-IC:/Code/v2/LN-200
IMU/../Components/include/lwIP" "-IC:/Code/v2/LN-200
IMU/../Components/include/lwIP/ipv4" "-IC:/Code/v2/LN-200
IMU/../Components/include/lwIP glue" -I. "-IC:/Code/v2/LN-200
IMU/../Components/include" "-IC:/Code/v2/LN-200 IMU/../Common"
-D__ARM_ARCH_4T__ -D__CROSSWORKS_ARM -D__CROSSWORKS_MAJOR_VERSION=2
-D__CROSSWORKS_MINOR_VERSION=0 -D__CROSSWORKS_REVISION=8
-D__TARGET_PROCESSOR=AT91SAM7X256 -DOSCILLATOR_CLOCK_FREQUENCY=18432000
"-DBOARDINIPATH = "imu.ini"" "-DdefaultIPAddr = 0x0006000A" "-DdefaultCANAddr =
0x00100600" "-DdefaultMacAddrA = 0x06" "-DBOARD_ID = BOARD_TYPE_LN200"
"-D_DRIVES = 1" -D__THUMB -D__FLASH_BUILD -DNDEBUG -DSAM7_GCC -DTHUMB_INTERWORK
-DSUPERVISOR_START -DSMARTPIGHARDWARE -MD "FPGA ISR.d" -MQ "FPGA ISR.o" -Werror
-quiet -g1 -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -fms-extensions -O1 -fno-dwarf2-cfi-asm -fno-builtin
"C:/Code/v2/LN-200 IMU/FPGA ISR.c"


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
  2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
@ 2011-04-05 22:30 ` mikpe at it dot uu.se
  2011-04-06 19:48 ` [Bug middle-end/48470] " mikpe at it dot uu.se
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mikpe at it dot uu.se @ 2011-04-05 22:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2011-04-05 22:30:36 UTC ---
I can easily reproduce the ICE with gcc-4.4.5 and 4.5.2 targeting
arm-linux-gnueabi, using the command line

gcc -O1 -S test.i

-mcpu= etc options don't seem to make any difference.

gcc-4.3.5 works.  Haven't been able to check 4.6.0 yet because there the test
case triggers errors in code that isn't valid C1X.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
  2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
  2011-04-05 22:30 ` [Bug c/48470] " mikpe at it dot uu.se
@ 2011-04-06 19:48 ` mikpe at it dot uu.se
  2011-07-26 15:57 ` gcc.ourteddybear at xoxy dot net
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mikpe at it dot uu.se @ 2011-04-06 19:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2011-04-06 19:48:25 UTC ---
Created attachment 23903
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23903
reduced test case

The test case reduces to the following:

void __attribute__((naked)) f(void)
{
    int x = 0;
    g(&x);
}

It ICEs 4.4.5, 4.5.2, and 4.6.0, but not 4.3.5, 4.2.4, or 4.1.2.

I suspect it isn't valid to make recursive calls or take the address of local
variables in naked functions.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
  2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
  2011-04-05 22:30 ` [Bug c/48470] " mikpe at it dot uu.se
  2011-04-06 19:48 ` [Bug middle-end/48470] " mikpe at it dot uu.se
@ 2011-07-26 15:57 ` gcc.ourteddybear at xoxy dot net
  2015-08-03 19:35 ` law at gcc dot gnu.org
  2015-08-03 19:36 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: gcc.ourteddybear at xoxy dot net @ 2011-07-26 15:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

--- Comment #3 from Stephen Cleary <gcc.ourteddybear at xoxy dot net> 2011-07-26 15:56:40 UTC ---
(In reply to comment #2)
> The test case reduces to the following:
> void __attribute__((naked)) f(void)
> {
>     int x = 0;
>     g(&x);
> }
> It ICEs 4.4.5, 4.5.2, and 4.6.0, but not 4.3.5, 4.2.4, or 4.1.2.
> I suspect it isn't valid to make recursive calls or take the address of local
> variables in naked functions.

It is important to note, however, that the original test case does not take the
address of a local variable in a naked function. The original test case is like
this:

static void g(void);
void __attribute__((naked)) f(void)
{
    g();
}
void g(void)
{
    int x = 0;
    h(&x);
}

So this may be due to overzealous inlining.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
  2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
                   ` (2 preceding siblings ...)
  2011-07-26 15:57 ` gcc.ourteddybear at xoxy dot net
@ 2015-08-03 19:35 ` law at gcc dot gnu.org
  2015-08-03 19:36 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: law at gcc dot gnu.org @ 2015-08-03 19:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Mon Aug  3 19:34:31 2015
New Revision: 226528

URL: https://gcc.gnu.org/viewcvs?rev=226528&root=gcc&view=rev
Log:
        PR middle-end/64744
        PR middle-end/48470
        PR middle-end/43404
        * cfgexpand.c (expand_one_var): Add check if stack is going to
        be used in naked function.
        * expr.c (expand_expr_addr_expr_1): Remove excess checking
        whether expression should not reside in MEM.
        * function.c (use_register_for_decl): Do not use registers for
        non-register things (volatile, float, BLKMode) in naked functions.

        PR middle-end/64744
        PR middle-end/48470
        PR middle-end/43404
        * gcc.target/arm/pr43404.c : New testcase.
        * gcc.target/arm/pr48470.c : New testcase.
        * gcc.target/arm/pr64744-1.c : New testcase.
        * gcc.target/arm/pr64744-2.c : New testcase.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr43404.c
    trunk/gcc/testsuite/gcc.target/arm/pr48470.c
    trunk/gcc/testsuite/gcc.target/arm/pr64744-1.c
    trunk/gcc/testsuite/gcc.target/arm/pr64744-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c
    trunk/gcc/expr.c
    trunk/gcc/function.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
  2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
                   ` (3 preceding siblings ...)
  2015-08-03 19:35 ` law at gcc dot gnu.org
@ 2015-08-03 19:36 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: law at redhat dot com @ 2015-08-03 19:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |FIXED

--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
Fixed on the trunk.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-03 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05 19:41 [Bug c/48470] New: ICE in expand_expr_addr_expr_1 at expr.c:6835 gcc.ourteddybear at xoxy dot net
2011-04-05 22:30 ` [Bug c/48470] " mikpe at it dot uu.se
2011-04-06 19:48 ` [Bug middle-end/48470] " mikpe at it dot uu.se
2011-07-26 15:57 ` gcc.ourteddybear at xoxy dot net
2015-08-03 19:35 ` law at gcc dot gnu.org
2015-08-03 19:36 ` law at redhat dot com

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).