[Bug ipa/87955] New: [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] New: [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

            Bug ID: 87955
           Summary: [9 Regression] ICE in cl_target_option_print_diff at
                    gcc/options-save.c:3803 since r265920
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Following is iceing:

$ cat /tmp/ice.i
float a;
__attribute__((__target__("fpmath=387")))

void b() {
  if (a)
    __builtin_abort();
}

void c() { b(); }

$ ./xgcc -B. -O2 -fopt-info /tmp/ice.i -c
during GIMPLE pass: einline
/tmp/ice.i: In function ‘c’:
/tmp/ice.i:9:1: internal compiler error: Segmentation fault
    9 | void c() { b(); }
      | ^~~~
0xd0f73f crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.c:325
0x7ffff6bc310f ???
       
/usr/src/debug/glibc-2.27-6.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7ffff6c03d8a fputc
        /usr/src/debug/glibc-2.27-6.1.x86_64/libio/fputc.c:35
0xc29812 cl_target_option_print_diff(_IO_FILE*, int, cl_target_option*,
cl_target_option*)
        /dev/shm/objdir/gcc/options-save.c:3803
0x155bf98 report_inline_failed_reason
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:248
0x155c470 can_inline_edge_p
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:381
0x155d386 can_early_inline_edge_p
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:578
0x1563c1b early_inline_small_functions
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:2690
0x1564018 early_inliner(function*)
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:2803
0x1564225 execute
        /home/marxin/Programming/gcc/gcc/ipa-inline.c:2885
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.0
      Known to fail|                            |9.0
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2018-11-09
           Assignee|unassigned at gcc dot gnu.org      |dmalcolm at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Sorry about that.  Confirmed; I'm working on a fix.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                URL|                            |https://gcc.gnu.org/ml/gcc-
                   |                            |patches/2018-11/msg00834.ht
                   |                            |ml

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Candidate patch: https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00834.html
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Author: dmalcolm
Date: Tue Nov 13 15:59:57 2018
New Revision: 266079

URL: https://gcc.gnu.org/viewcvs?rev=266079&root=gcc&view=rev
Log:
Fix ICE with -fopt-info-inline (PR ipa/87955)

PR ipa/87955 reports a problem I introduced in r265920, where I converted
the guard in report_inline_failed_reason from using:
  if (dump_file)
to using
  if (dump_enabled_p ()).
without updating the calls to cl_target_option_print_diff and
cl_optimization_print_diff, which assume that dump_file is non-NULL.

The functions are auto-generated.  Rather than porting them to the dump
API, this patch applies the workaround of adding the missing checks on
dump_file before calling them.

gcc/ChangeLog:
        PR ipa/87955
        * ipa-inline.c (report_inline_failed_reason): Guard calls to
        cl_target_option_print_diff and cl_optimization_print_diff with
        if (dump_file).

gcc/testsuite/ChangeLog:
        PR ipa/87955
        * gcc.target/i386/pr87955.c: New test.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr87955.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-inline.c
    trunk/gcc/testsuite/ChangeLog
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

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

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by r266079.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |ro at gcc dot gnu.org
         Resolution|FIXED                       |---

--- Comment #5 from Rainer Orth <ro at gcc dot gnu.org> ---
The new testcase FAILs on 32-bit Solaris/x86, FreeBSD, and Linux:

+FAIL: gcc.target/i386/pr87955.c  (test for errors, line 10)

I suspect it needs to be restricted to target lp64?
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Mon Dec 10 13:30:49 2018
New Revision: 266954

URL: https://gcc.gnu.org/viewcvs?rev=266954&root=gcc&view=rev
Log:
        PR ipa/87955
        * gcc.target/i386/pr87955.c: Add -msse2 -mfpmath=sse to dg-options.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/pr87955.c
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87955] [9 Regression] ICE in cl_target_option_print_diff at gcc/options-save.c:3803 since r265920

ro at gcc dot gnu.org
In reply to this post by ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87955

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.