public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351
@ 2022-04-27 14:39 ro at gcc dot gnu.org
  2022-04-27 14:40 ` [Bug middle-end/105409] " ro at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ro at gcc dot gnu.org @ 2022-04-27 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105409
           Summary: ICE in simplify_subreg, at simplify-rtx.cc:7351
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: gaius at gcc dot gnu.org
  Target Milestone: ---
            Target: sparcv9-sun-solaris2.11

As (incorrectly) reported in PR modula2/105408, for a 64-bit-default
Solaris/SPARC
build of the devel/modula-2 branch, 2000+ 32-bit testcases FAIL like this:

FAIL: gm2/calling-c/datatypes/unbounded/run/pass/m.mod compilation,  -O 
(internal compiler error: ^[[m^[[Kin simplify_subreg, at simplify-rtx.cc:7351)

However, it turns out that this has nothing to do with gm2, because the same
ICE
occurs on trunk as well (but only for a 64-bit-default g++, 32-bit-default
compiles
the testcase just fine):

$ cc1plus -m32 -quiet m.x0-m_m2.cpp
m.x0-m_m2.cpp:111:1: internal compiler error: in simplify_subreg, at
simplify-rtx.cc:7351
  111 | }
      | ^
0x101360647 simplify_context::simplify_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
        /vol/gcc/src/hg/master/local/gcc/simplify-rtx.cc:7351
0x1017e071b simplify_subreg(machine_mode, rtx_def*, machine_mode, poly_int<1u,
unsigned long>)
        /vol/gcc/src/hg/master/local/gcc/rtl.h:3498
0x1017e071b assemble_integer(rtx_def*, unsigned int, unsigned int, int)
        /vol/gcc/src/hg/master/local/gcc/varasm.cc:2922
0x100db88eb dw2_asm_output_encoded_addr_rtx(int, rtx_def*, bool, char const*,
...)
        /vol/gcc/src/hg/master/local/gcc/dwarf2asm.cc:1122
0x100dc919f output_call_frame_info
        /vol/gcc/src/hg/master/local/gcc/dwarf2out.cc:929

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

* [Bug middle-end/105409] ICE in simplify_subreg, at simplify-rtx.cc:7351
  2022-04-27 14:39 [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351 ro at gcc dot gnu.org
@ 2022-04-27 14:40 ` ro at gcc dot gnu.org
  2022-05-05  8:24 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ro at gcc dot gnu.org @ 2022-04-27 14:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 52891
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52891&action=edit
testcase

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

* [Bug middle-end/105409] ICE in simplify_subreg, at simplify-rtx.cc:7351
  2022-04-27 14:39 [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351 ro at gcc dot gnu.org
  2022-04-27 14:40 ` [Bug middle-end/105409] " ro at gcc dot gnu.org
@ 2022-05-05  8:24 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2022-05-05 13:59 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2022-05-05 16:27 ` gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2022-05-05  8:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> $ cc1plus -m32 -quiet m.x0-m_m2.cpp
> m.x0-m_m2.cpp:111:1: internal compiler error: in simplify_subreg, at
> simplify-rtx.cc:7351
>   111 | }
>       | ^

If one compiles the testcase with a sparcv9-sun-solaris2.11 g++, it
works just fine.  However, the cc1plus invocation is different:

cc1plus -mptr32 -mno-stack-bias -quiet -m32 -mcpu=v9 m.x0-m_m2.cpp

Omitting the -mptr32 lets the ICE resurface.

It seems gm2 omits CC1_SPEC from the cc1/cc1plus invocation in
gcc/m2/m2-link-support.h.

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

* [Bug middle-end/105409] ICE in simplify_subreg, at simplify-rtx.cc:7351
  2022-04-27 14:39 [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351 ro at gcc dot gnu.org
  2022-04-27 14:40 ` [Bug middle-end/105409] " ro at gcc dot gnu.org
  2022-05-05  8:24 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2022-05-05 13:59 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2022-05-05 16:27 ` gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2022-05-05 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> It seems gm2 omits CC1_SPEC from the cc1/cc1plus invocation in
> gcc/m2/m2-link-support.h.

Indeed: the following trivial patch works wonders indeed:

diff --git a/gcc/m2/m2-link-support.h b/gcc/m2/m2-link-support.h
--- a/gcc/m2/m2-link-support.h
+++ b/gcc/m2/m2-link-support.h
@@ -52,7 +52,7 @@ along with GCC; see the file COPYING3.  
    compiler.  */

 #define GM2CC(INPUT,OUTPUT) \
-  "%{!fno-exceptions:cc1plus;:cc1} " GM2CC_OPTIONS " " INPUT " \
+  "%{!fno-exceptions:cc1plus;:cc1} %1 " GM2CC_OPTIONS " " INPUT " \
      -o %d" SCAFFOLDNAME ".s \n\
   " AS(SCAFFOLDNAME ".s",OUTPUT) " "

With it, I get the following test results on sparcv9-sun-solaris2.11:

                === gm2 Summary for unix ===

# of expected passes            11721
# of unexpected failures        7
# of unresolved testcases       1

                === gm2 Summary for unix/-m32 ===

# of expected passes            11706
# of unexpected failures        22
# of unresolved testcases       1

                === gm2 Summary ===

# of expected passes            23427
# of unexpected failures        29
# of unresolved testcases       2

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

* [Bug middle-end/105409] ICE in simplify_subreg, at simplify-rtx.cc:7351
  2022-04-27 14:39 [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351 ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-05-05 13:59 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2022-05-05 16:27 ` gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-05-05 16:27 UTC (permalink / raw)
  To: gcc-bugs

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

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Many thanks for the patch, diagnosis and test - I've applied the patch on the
modula2 branch.

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

end of thread, other threads:[~2022-05-05 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 14:39 [Bug middle-end/105409] New: ICE in simplify_subreg, at simplify-rtx.cc:7351 ro at gcc dot gnu.org
2022-04-27 14:40 ` [Bug middle-end/105409] " ro at gcc dot gnu.org
2022-05-05  8:24 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-05-05 13:59 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-05-05 16:27 ` gaius at gcc dot gnu.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).