[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 --- Comment #7 from Jeffrey A. Law --- 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
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 Jeffrey A. Law changed: What|Removed |Added Status|NEW |RESOLVED CC||law at redhat dot com Resolution|--- |FIXED --- Comment #8 from Jeffrey A. Law --- Fixed on the trunk.
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 --- Comment #6 from Alexander Basov --- Hi, could you please take a look at this fix: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00027.html It also fixes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48470 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43404
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 jgreenhalgh at gcc dot gnu.org changed: What|Removed |Added Target|aarch64 |arm-none-linux-gnueabihf Status|UNCONFIRMED |NEW Last reconfirmed||2015-01-23 CC||jgreenhalgh at gcc dot gnu.org Host|x86_64 |x86_64-unknown-linux-gnu Ever confirmed|0 |1 --- Comment #1 from jgreenhalgh at gcc dot gnu.org --- I can't reproduce this for an AArch64 target. As far as I can remember, we don't support __attribute__((naked)) for AArch64, so I would expect the attribute to be ignored (And that is what I see with your testcase): gcc foo.c -O0 foo.c:3:1: warning: ‘naked’ attribute directive ignored [-Wattributes] { ^ However, I can reproduce your bug with an ARM compiler (cross and native), so I'll confirm the bug, and update the Target field for you.
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 --- Comment #2 from Alexander Basov --- Yep, sorry it's for ARM target.
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 ktkachov at gcc dot gnu.org changed: What|Removed |Added CC||ktkachov at gcc dot gnu.org Known to fail||4.8.5, 4.9.3, 5.0 --- Comment #3 from ktkachov at gcc dot gnu.org --- Confirmed as well on all release branches.
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 --- Comment #4 from Alexander Basov --- (In reply to ktkachov from comment #3) > Confirmed as well on all release branches. Ok, If you have no any objections, I'd like to fix it. BTW, what gcc should do with such code?
[Bug middle-end/64744] ARM: gcc internal compiler error: in store_field, at expr.c:6659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744 --- Comment #5 from ktkachov at gcc dot gnu.org --- (In reply to Alexander Basov from comment #4) > (In reply to ktkachov from comment #3) > > Confirmed as well on all release branches. > > Ok, If you have no any objections, I'd like to fix it. > > BTW, what gcc should do with such code? Patches welcome :) Though I note the ICE only happens at -O0 and disappears if you enable any optimisation. According to: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html the 'naked' attribute will omit the prologue/epilogue of the function but it's supposed to be used only with inline asm and C code is not expected to work reliably. That being said, we should never ICE...