public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
@ 2013-04-06 18:07 steven at gcc dot gnu.org
  2013-04-06 18:09 ` [Bug target/56858] " steven at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: steven at gcc dot gnu.org @ 2013-04-06 18:07 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56858
           Summary: alpha looks for NOTE_INSN_EH_REGION notes that cannot
                    exist
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: steven@gcc.gnu.org


Via alpha.c:alpha_handle_trap_shadows(), the alpha_reorg pass
looks for NOTE_INSN_EH_REGION_BEG and NOTE_INSN_EH_REGION_END
notes. But those notes are created much later, and can never
exist in the machine-dependent reorg pass.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
@ 2013-04-06 18:09 ` steven at gcc dot gnu.org
  2013-04-06 21:56 ` steven at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu.org @ 2013-04-06 18:09 UTC (permalink / raw)
  To: gcc-bugs


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

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |alpha-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-06
                 CC|                            |rth at gcc dot gnu.org,
                   |                            |uros at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2013-04-06 18:09:00 UTC ---
>From passes.c, the pass pipeline:

          NEXT_PASS (pass_machine_reorg);
          NEXT_PASS (pass_cleanup_barriers);
          NEXT_PASS (pass_delay_slots);
          NEXT_PASS (pass_split_for_shorten_branches);
          NEXT_PASS (pass_convert_to_eh_region_ranges);

alpha's pass_machine_reorg looks for notes that
pass_convert_to_eh_region_ranges creates.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
  2013-04-06 18:09 ` [Bug target/56858] " steven at gcc dot gnu.org
@ 2013-04-06 21:56 ` steven at gcc dot gnu.org
  2013-04-07  8:28 ` ubizjak at gmail dot com
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu.org @ 2013-04-06 21:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2013-04-06 21:55:57 UTC ---
Proposed fix:

Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c        (revision 197532)
+++ config/alpha/alpha.c        (working copy)
@@ -8568,11 +8568,10 @@ static void
 alpha_handle_trap_shadows (void)
 {
   struct shadow_summary shadow;
-  int trap_pending, exception_nesting;
+  int trap_pending;
   rtx i, n;

   trap_pending = 0;
-  exception_nesting = 0;
   shadow.used.i = 0;
   shadow.used.fp = 0;
   shadow.used.mem = 0;
@@ -8582,25 +8581,9 @@ alpha_handle_trap_shadows (void)
     {
       if (NOTE_P (i))
        {
-         switch (NOTE_KIND (i))
-           {
-           case NOTE_INSN_EH_REGION_BEG:
-             exception_nesting++;
-             if (trap_pending)
-               goto close_shadow;
-             break;
-
-           case NOTE_INSN_EH_REGION_END:
-             exception_nesting--;
-             if (trap_pending)
-               goto close_shadow;
-             break;
-
-           case NOTE_INSN_EPILOGUE_BEG:
-             if (trap_pending && alpha_tp >= ALPHA_TP_FUNC)
-               goto close_shadow;
-             break;
-           }
+         if (NOTE_KIND (i) == NOTE_INSN_EPILOGUE_BEG
+             && trap_pending && alpha_tp >= ALPHA_TP_FUNC)
+           goto close_shadow;
        }
       else if (trap_pending)
        {
@@ -8683,7 +8666,7 @@ alpha_handle_trap_shadows (void)
            }
        }

-      if ((exception_nesting > 0 || alpha_tp >= ALPHA_TP_FUNC)
+      if (alpha_tp >= ALPHA_TP_FUNC
          && NONJUMP_INSN_P (i)
          && GET_CODE (PATTERN (i)) != USE
          && GET_CODE (PATTERN (i)) != CLOBBER


I can't test this because I have no access to alpha hardware.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
  2013-04-06 18:09 ` [Bug target/56858] " steven at gcc dot gnu.org
  2013-04-06 21:56 ` steven at gcc dot gnu.org
@ 2013-04-07  8:28 ` ubizjak at gmail dot com
  2013-04-08  7:38 ` ubizjak at gmail dot com
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2013-04-07  8:28 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2013-04-07 08:28:44 UTC ---
(In reply to comment #2)

> I can't test this because I have no access to alpha hardware.

I'll bootstrap and regression test the patch on ev68, please expect results in
a couple of days.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-04-07  8:28 ` ubizjak at gmail dot com
@ 2013-04-08  7:38 ` ubizjak at gmail dot com
  2013-04-08 14:35 ` rth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2013-04-08  7:38 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2013-04-08 07:38:26 UTC ---
(In reply to comment #2)

> I can't test this because I have no access to alpha hardware.

The testsuite results [1] are OK.

[1] http://gcc.gnu.org/ml/gcc-testresults/2013-04/msg00797.html


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-04-08  7:38 ` ubizjak at gmail dot com
@ 2013-04-08 14:35 ` rth at gcc dot gnu.org
  2013-04-08 15:32 ` steven at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rth at gcc dot gnu.org @ 2013-04-08 14:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Henderson <rth at gcc dot gnu.org> 2013-04-08 14:35:03 UTC ---
They did used to exist during mach_reorg; they used to exist at rtl creation
time.  You cannot simply delete the code either, that produces wrong-code wrt
fp exceptions.  Of course, we've got wrong-code now, regressed from the last
rtl exception rewrite.

Uros, testing ev68 wouldn't even have executed this code.  This is intended for
ev4 and ev5, without the precise fp exceptions in ev6.  You can test this code
for ICEs on an ev68 host if you don't actually configure alphaev68-*-*, but you
won't see any potential runtime failures either way.

I briefly looked at what one would have to do with the current state of rtl
exceptions, and I'm thinking that it might be easier to split out the trap
shadow handling from machine_reorg and use the pass manager to insert a new
pass after we've re-converted to eh region notes.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-04-08 14:35 ` rth at gcc dot gnu.org
@ 2013-04-08 15:32 ` steven at gcc dot gnu.org
  2013-04-08 15:52 ` rth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu.org @ 2013-04-08 15:32 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Steven Bosscher <steven at gcc dot gnu.org> 2013-04-08 15:32:47 UTC ---
(In reply to comment #5)
> They did used to exist during mach_reorg; they used to exist at rtl 
> creation time.  You cannot simply delete the code either, that produces
> wrong-code wrt fp exceptions.  Of course, we've got wrong-code now, 
> regressed from the last rtl exception rewrite.

Do you recall when that was? Must have been long, long ago...
I've tried to find where it happened, and the rewrite was done before
at least r43893 (Tue Jul 10 10:38:10 2001 UTC (11 years, 9 months ago).

Does that mean alpha ev4 and ev5 fp exceptions have been broken for
maybe 12 years? If that's really the case then I'd say the proper way
forward is to remove support for those alpha variants as they're
obviously not used and/or tested by anyone...


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-04-08 15:32 ` steven at gcc dot gnu.org
@ 2013-04-08 15:52 ` rth at gcc dot gnu.org
  2013-04-08 18:43 ` steven at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rth at gcc dot gnu.org @ 2013-04-08 15:52 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Richard Henderson <rth at gcc dot gnu.org> 2013-04-08 15:52:13 UTC ---
(In reply to comment #6)
> Do you recall when that was? Must have been long, long ago...
> I've tried to find where it happened, and the rewrite was done before
> at least r43893 (Tue Jul 10 10:38:10 2001 UTC (11 years, 9 months ago).

I would have said it was much more recent than that, but I just checked
gcc 4.2 and you're right that we'd already switched away from these notes
somewhere prior to 2009.

> Does that mean alpha ev4 and ev5 fp exceptions have been broken for
> maybe 12 years? If that's really the case then I'd say the proper way
> forward is to remove support for those alpha variants as they're
> obviously not used and/or tested by anyone...

It's not as bad as all that.  It's only the extremely uncommon case of
throwing a c++ exception in response to an fp exception, with a handler
in the same function.  My guess is that no one at all does this, and so
the wrong-code is somewhat theoretical.

Normal fp code without c++ exceptions is working fine.

Which is why I would not suggest writing new eh code for this, but
instead moving the existing code to later in the pass list where merely
adding an insn is good enough to have the insn included in the region.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-04-08 15:52 ` rth at gcc dot gnu.org
@ 2013-04-08 18:43 ` steven at gcc dot gnu.org
  2013-04-08 19:27 ` rth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu.org @ 2013-04-08 18:43 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Steven Bosscher <steven at gcc dot gnu.org> 2013-04-08 18:43:25 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > Do you recall when that was? Must have been long, long ago...
> > I've tried to find where it happened, and the rewrite was done before
> > at least r43893 (Tue Jul 10 10:38:10 2001 UTC (11 years, 9 months ago).
> 
> I would have said it was much more recent than that, but I just checked
> gcc 4.2 and you're right that we'd already switched away from these notes
> somewhere prior to 2009.
> 
> > Does that mean alpha ev4 and ev5 fp exceptions have been broken for
> > maybe 12 years? If that's really the case then I'd say the proper way
> > forward is to remove support for those alpha variants as they're
> > obviously not used and/or tested by anyone...
> 
> It's not as bad as all that.  It's only the extremely uncommon case of
> throwing a c++ exception in response to an fp exception, with a handler
> in the same function.  My guess is that no one at all does this, and so
> the wrong-code is somewhat theoretical.
> 
> Normal fp code without c++ exceptions is working fine.
> 
> Which is why I would not suggest writing new eh code for this, but
> instead moving the existing code to later in the pass list where merely
> adding an insn is good enough to have the insn included in the region.

I really don't like that idea. As it is, these notes are already de facto
alpha specific.  The only references to these notes:

Emitters:
except.c:               note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
except.c:               note = emit_note_after (NOTE_INSN_EH_REGION_END,
except.c:                   note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
except.c:               note = emit_note_after (NOTE_INSN_EH_REGION_END,
except.c:               note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
iter);
except.c:      note = emit_note_after (NOTE_INSN_EH_REGION_END,
last_action_insn);

Printers / doc:
print-rtl.c:          case NOTE_INSN_EH_REGION_BEG:
print-rtl.c:          case NOTE_INSN_EH_REGION_END:
sched-vis.c:      case NOTE_INSN_EH_REGION_BEG:
sched-vis.c:      case NOTE_INSN_EH_REGION_END:
insn-notes.def:INSN_NOTE (EH_REGION_BEG)
insn-notes.def:INSN_NOTE (EH_REGION_END)
doc/rtl.texi:@findex NOTE_INSN_EH_REGION_BEG
doc/rtl.texi:@findex NOTE_INSN_EH_REGION_END
doc/rtl.texi:@item NOTE_INSN_EH_REGION_BEG
doc/rtl.texi:@itemx NOTE_INSN_EH_REGION_END

Actual uses of the notes:
final.c:        case NOTE_INSN_EH_REGION_BEG:
final.c:        case NOTE_INSN_EH_REGION_END:
config/alpha/alpha.c:       case NOTE_INSN_EH_REGION_BEG:
config/alpha/alpha.c:       case NOTE_INSN_EH_REGION_END:


FWIW my r43893 reference is based on inspection of toplev.c around
that time.  See e.g.:
http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/toplev.c?revision=43872&view=markup

Just before "integrate" (RTL inlining!) there is a call on line 2801 to 
"convert_from_eh_region_ranges ()" to come from INSN_NOTE based regions
to REG_NOTE based regions.  Just before shorten_branches, on line 3742,
the INSN_NOTE representation is restored via convert_to_eh_region_ranges.
The machine-dependent reorg pass runs before it, see line 3689.

Continuing the archaeology a bit with "svn blame -r43872 toplev.c":

40924 rth /* Convert from NOTE_INSN_EH_REGION style notes, and do other
40924 rth    sorts of eh initialization.  Delay this until after the
40924 rth    initial rtl dump so that we can see the original nesting.  */
40924 rth convert_from_eh_region_ranges ();

and:

40924 rth
40924 rth   convert_to_eh_region_ranges ();

The commit log for http://gcc.gnu.org/r40924 (Mar 28 2001) is:
"IA-64 ABI Exception Handling."

The part of alpha EH that depends on the notes must have been been
broken since than, more than 12 years.  Without anyone noticing...

I really, really wouldn't like to keep this code in alpha alive, and
with it these REG_EH_REGION notes, for barely (if at all) used ages-old
alpha targets...


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2013-04-08 18:43 ` steven at gcc dot gnu.org
@ 2013-04-08 19:27 ` rth at gcc dot gnu.org
  2013-04-08 19:42 ` stevenb.gcc at gmail dot com
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rth at gcc dot gnu.org @ 2013-04-08 19:27 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #9 from Richard Henderson <rth at gcc dot gnu.org> 2013-04-08 19:27:03 UTC ---
(In reply to comment #8)
> The part of alpha EH that depends on the notes must have been been
> broken since than, more than 12 years.  Without anyone noticing...

Sure.  Do you know any package that combines C++ EH with IEEE exceptions?
I don't.  In fact, I don't actually know of a package that wants to enable
trapping fp math at all.

> I really, really wouldn't like to keep this code in alpha alive, and
> with it these REG_EH_REGION notes, for barely (if at all) used ages-old
> alpha targets...

Do you believe that you're going to be able to delete the notes entirely,
and that it's only Alpha that's keeping them alive?  That's certainly not
true, I assure you.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2013-04-08 19:27 ` rth at gcc dot gnu.org
@ 2013-04-08 19:42 ` stevenb.gcc at gmail dot com
  2013-04-08 20:09 ` rth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: stevenb.gcc at gmail dot com @ 2013-04-08 19:42 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #10 from stevenb.gcc at gmail dot com <stevenb.gcc at gmail dot com> 2013-04-08 19:42:51 UTC ---
> Sure.  Do you know any package that combines C++ EH with IEEE exceptions?
> I don't.  In fact, I don't actually know of a package that wants to enable
> trapping fp math at all.

I barely know a thing about EH, or IEEE exceptions, let alone a
combination or two. I'm a doc^Wn aerospace engineer, not a computer
scientist.

> Do you believe that you're going to be able to delete the notes entirely,
> and that it's only Alpha that's keeping them alive?  That's certainly not
> true, I assure you.

Removing the notes entirely is the goal eventually, but I'd settle for
making them local to final.c for now.

What besides alpha and final are keeping these notes alive? You've
probably seen my grep results, and at least from passes.c there
doesn't seem to be anything between pass_convert_to_eh_region_ranges
and pass_final that would use the INSN_NOTEs:

          NEXT_PASS (pass_convert_to_eh_region_ranges);
          NEXT_PASS (pass_shorten_branches);
          NEXT_PASS (pass_set_nothrow_function_flags);
          NEXT_PASS (pass_dwarf2_frame);
          NEXT_PASS (pass_final);

AFAIU the only code transformations done in these passes are in
shorten_branches that shouldn't care whether it's dealing with the
REG_EH_REGION notes or the NOTE_INSN_EH_REGION notes.

But my U in AFAIU is obviously no-where near your U when it comes to
EH, so if you can explain a bit, I'd really appreciate it! :-)

(On the topic of notes: note to self, kill NOTE_EH_CONTEXT.)


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2013-04-08 19:42 ` stevenb.gcc at gmail dot com
@ 2013-04-08 20:09 ` rth at gcc dot gnu.org
  2013-04-21 21:15 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rth at gcc dot gnu.org @ 2013-04-08 20:09 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #11 from Richard Henderson <rth at gcc dot gnu.org> 2013-04-08 20:09:47 UTC ---
(In reply to comment #10)
> Removing the notes entirely is the goal eventually, but I'd settle for
> making them local to final.c for now.

Hmm.

Well, assuming we want to fix this correctly, and not just define ev[45]
as no longer completely supported, we just have to write new code to emit
the trap insns into the proper EH region.  There's an overlap in effort
in finding the region boundaries, but probably not so much as to worry about.
I.e. really just the one lookup call and a pointer comparison.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2013-04-08 20:09 ` rth at gcc dot gnu.org
@ 2013-04-21 21:15 ` ubizjak at gmail dot com
  2013-04-21 21:36 ` stevenb.gcc at gmail dot com
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2013-04-21 21:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #12 from Uros Bizjak <ubizjak at gmail dot com> 2013-04-21 21:15:50 UTC ---
Created attachment 29911
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29911
Patch that introduces trap_shadows pass after eh_ranges

2013-04-18  Uros Bizjak  <ubizjak@gmail.com>

    PR target/56858
    * config/alpha/alpha.c: Include tree-pass.h.
    (gate_handle_trap_shadows): New static function.
    (rest_of_handle_trap_shadows): Ditto.
    (pass_handle_trap_shadows): New rtl_opt_pass structure.
    (alpha_option_override): Register trap_shadows pass after
    eh_ranges pass.
    (alpha_reorg): Do not call alpha_handle_trap_shadows here.

Attached patch adds trap_shadows handling pass after eh_ranges pass. The patch
was bootstrapped (configured with --host=alpha-linux-gnu
--build=alpha-linux-gnu --target=alpha-linux-gnu to make the pass effective).

The patch uncovered one issue with g++.dg/torture/stackalign/eh-vararg-1.C:

eh_ranges pass iserts a note between the call and its CALL_ARG_LOCATION note:

(call_insn:TI 175 238 243 (parallel [
            (call (mem:DI (reg:DI 27 $27) [0 S8 A64])
                (const_int 0 [0]))
            (use (reg:DI 29 $29))
            (use (symbol_ref:DI ("__cxa_throw") [flags 0x41]  <function_decl
0x200068f6300 __cxa_throw>))
            (use (const_int 14 [0xe]))
            (clobber (reg:DI 26 $26))
        ]) eh-vararg-1.C:62 211 {*call_osf_2_er_nogp}
     (expr_list:REG_DEAD (reg:DI 29 $29)
        (expr_list:REG_DEAD (reg:DI 27 $27)
            (expr_list:REG_DEAD (reg:DI 18 $18)
                (expr_list:REG_DEAD (reg:DI 17 $17)
                    (expr_list:REG_DEAD (reg:DI 16 $16)
                        (expr_list:REG_EH_REGION (const_int 1 [0x1])
                            (expr_list:REG_NORETURN (const_int 0 [0])
                                (nil))))))))
    (expr_list:REG_CC_SETTER (use (reg:DI 18 $18))
        (expr_list:REG_CC_SETTER (use (reg:DI 17 $17))
            (expr_list:REG_CC_SETTER (use (reg:DI 16 $16))
                (nil)))))
(note:TI 240 243 222 0 NOTE_INSN_EH_REGION_END)
(note 222 240 234 (expr_list:REG_DEP_TRUE (concat:DI (pc)
        (unspec:DI [
                (reg:DI 29 $29)
                (symbol_ref:DI ("__cxa_throw") [flags 0x41]  <function_decl
0x200068f6300 __cxa_throw>)
                (const_int 14 [0xe])
            ] UNSPEC_LITERAL))
    (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 18 $18)
            (const_int 0 [0]))
        (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 17 $17)
                (unspec:DI [
                        (reg:DI 29 $29)
                        (symbol_ref/i:DI ("_ZTI1A")  <var_decl 0x200067c1b50
_ZTI1A>)
                        (const_int 0 [0])
                    ] UNSPEC_LITERAL))
            (nil)))) NOTE_INSN_CALL_ARG_LOCATION)
(insn 234 222 119 (const_int 2 [0x2]) 294 {unop}
     (nil))

The new trap_shadows pass inserts

(insn:TI 243 175 240 (unspec_volatile [
            (const_int 0 [0])
        ] UNSPECV_TRAPB) -1
     (nil))

just above NOTE_INSN_EH_REGION_END note, and this breaks compilation (-O2 -g)
in:

/home/uros/gcc-svn/trunk/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C:65:1:
internal compiler error: in dwarf2out_var_location, at dwarf2out.c:20838^M
0x120537c6b dwarf2out_var_location^M
        ../../gcc-svn/trunk/gcc/dwarf2out.c:20834^M
0x1205dd753 final_scan_insn(rtx_def*, _IO_FILE*, int, int, int*)^M
        ../../gcc-svn/trunk/gcc/final.c:2276^M
0x1205deb37 final(rtx_def*, _IO_FILE*, int)^M
        ../../gcc-svn/trunk/gcc/final.c:1957^M
0x1205df0fb rest_of_handle_final^M
        ../../gcc-svn/trunk/gcc/final.c:4332^M
Please submit a full bug report,^M

20829           = ggc_alloc_cleared_call_arg_loc_node ();
20830         rtx prev = prev_real_insn (loc_note), x;
20831         ca_loc->call_arg_loc_note = loc_note;
20832         ca_loc->next = NULL;
20833         ca_loc->label = last_label;
20834         gcc_assert (prev
20835                     && (CALL_P (prev)
20836                         || (NONJUMP_INSN_P (prev)
20837                             && GET_CODE (PATTERN (prev)) == SEQUENCE
20838                             && CALL_P (XVECEXP (PATTERN (prev), 0,
0)))));

Steven, is it possible to emit NOTE_INSN_EH_REGION_END in such way that it
would not split the call and its NOTE_INSN_CALL_ARG_LOCATION? This would solve
the above problem in the most elegant way.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2013-04-21 21:15 ` ubizjak at gmail dot com
@ 2013-04-21 21:36 ` stevenb.gcc at gmail dot com
  2014-06-26 10:15 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: stevenb.gcc at gmail dot com @ 2013-04-21 21:36 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #13 from stevenb.gcc at gmail dot com <stevenb.gcc at gmail dot com> 2013-04-21 21:36:32 UTC ---
> Steven, is it possible to emit NOTE_INSN_EH_REGION_END in such way that it
> would not split the call and its NOTE_INSN_CALL_ARG_LOCATION? This would solve
> the above problem in the most elegant way.

The most elegant way is to not use NOTE_INSN_EH_REGION notes. I don't
like the proposed fix, the notes should be created only for final.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2013-04-21 21:36 ` stevenb.gcc at gmail dot com
@ 2014-06-26 10:15 ` ubizjak at gmail dot com
  2014-06-26 10:17 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2014-06-26 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #12)

> Steven, is it possible to emit NOTE_INSN_EH_REGION_END in such way that it
> would not split the call and its NOTE_INSN_CALL_ARG_LOCATION? This would
> solve the above problem in the most elegant way.

Actually, it is "barriers" pass that splits the call and its
NOTE_INSN_CALL_ARG_LOCATION. Before the pass, we have:

(call_insn:TI 117 113 196 (parallel [
            (call (mem:DI (symbol_ref:DI ("__cxa_throw") [flags 0x41] 
<function_decl 0x7ff44719f900 __cxa_throw>) [0 __cxa_throw S8 A64])
                (const_int 0 [0]))
            (use (reg:DI 29 $29))
            (clobber (reg:DI 26 $26))
        ]) eh-vararg-1.C:62 207 {*call_osf_1_noreturn}
     (expr_list:REG_DEAD (reg:DI 18 $18)
        (expr_list:REG_DEAD (reg:DI 17 $17)
            (expr_list:REG_DEAD (reg:DI 16 $16)
                (expr_list:REG_EH_REGION (const_int 1 [0x1])
                    (expr_list:REG_CALL_DECL (symbol_ref:DI ("__cxa_throw")
[flags 0x41]  <function_decl 0x7ff44719f900 __cxa_throw>)
                        (expr_list:REG_NORETURN (const_int 0 [0])
                            (nil)))))))
    (expr_list:DI (use (reg:DI 16 $16))
        (expr_list:DI (use (reg:DI 17 $17))
            (expr_list:DI (use (reg:DI 18 $18))
                (nil)))))
(note 196 117 195 (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 17 $17)
        (symbol_ref/i:DI ("_ZTI1A")  <var_decl 0x7ff447194630 _ZTI1A>))
    (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 18 $18)
            (const_int 0 [0]))
        (nil))) NOTE_INSN_CALL_ARG_LOCATION)
(note/c 195 196 118 (var_location this (nil)) NOTE_INSN_VAR_LOCATION)
(barrier 118 195 197)

and "barriers" pass reorders this sequence to:

(call_insn:TI 117 113 118 (parallel [
            (call (mem:DI (symbol_ref:DI ("__cxa_throw") [flags 0x41] 
<function_decl 0x7f21556d0900 __cxa_throw>) [0 __cxa_throw S8 A64])
                (const_int 0 [0]))
            (use (reg:DI 29 $29))
            (clobber (reg:DI 26 $26))
        ]) eh-vararg-1.C:62 207 {*call_osf_1_noreturn}
     (expr_list:REG_DEAD (reg:DI 18 $18)
        (expr_list:REG_DEAD (reg:DI 17 $17)
            (expr_list:REG_DEAD (reg:DI 16 $16)
                (expr_list:REG_EH_REGION (const_int 1 [0x1])
                    (expr_list:REG_CALL_DECL (symbol_ref:DI ("__cxa_throw")
[flags 0x41]  <function_decl 0x7f21556d0900 __cxa_throw>)
                        (expr_list:REG_NORETURN (const_int 0 [0])
                            (nil)))))))
    (expr_list:DI (use (reg:DI 16 $16))
        (expr_list:DI (use (reg:DI 17 $17))
            (expr_list:DI (use (reg:DI 18 $18))
                (nil)))))
(barrier 118 117 196)
(note 196 118 195 (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 17 $17)
        (symbol_ref/i:DI ("_ZTI1A")  <var_decl 0x7f21556c5630 _ZTI1A>))
    (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 18 $18)
            (const_int 0 [0]))
        (nil))) NOTE_INSN_CALL_ARG_LOCATION)
(note/c 195 196 197 (var_location this (nil)) NOTE_INSN_VAR_LOCATION)

Indeed the purpose of "barriers" RTL pass is (from jump.c):

--cut here--
/* Some old code expects exactly one BARRIER as the NEXT_INSN of a
   non-fallthru insn.  This is not generally true, as multiple barriers
   may have crept in, or the BARRIER may be separated from the last
   real insn by one or more NOTEs.

   This simple pass moves barriers and removes duplicates so that the
   old code is happy.
 */
static unsigned int
cleanup_barriers (void)
{
  rtx insn, next, prev;
  for (insn = get_insns (); insn; insn = next)
    {
      next = NEXT_INSN (insn);
      if (BARRIER_P (insn))
    {
      prev = prev_nonnote_insn (insn);
      if (!prev)
        continue;
      if (BARRIER_P (prev))
        delete_insn (insn);
      else if (prev != PREV_INSN (insn))
        reorder_insns_nobb (insn, insn, prev);
    }
    }
  return 0;
}
--cut here--

This is the hack to "keep the old code happy" (?!), instead of teaching the
problematic code that varous debug notes can be between paired insns in the
insn stream.
>From gcc-bugs-return-455001-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 26 10:17:27 2014
Return-Path: <gcc-bugs-return-455001-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19994 invoked by alias); 26 Jun 2014 10:17:26 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19967 invoked by uid 48); 26 Jun 2014 10:17:23 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61507] GCC does not compile function with parameter pack.
Date: Thu, 26 Jun 2014 10:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.1
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution target_milestone
Message-ID: <bug-61507-4-uemx3WxWeD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61507-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61507-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg02083.txt.bz2
Content-length: 518

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida507

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.1

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thus I would say fixed for 4.9.1.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2014-06-26 10:15 ` ubizjak at gmail dot com
@ 2014-06-26 10:17 ` ubizjak at gmail dot com
  2014-07-11  7:43 ` uros at gcc dot gnu.org
  2014-07-14 14:09 ` ubizjak at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2014-06-26 10:17 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2828 bytes --]

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

--- Comment #15 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 33009
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33009&action=edit
Updated patch that introduces trap_shadows pass after eh_ranges

Updated patch due to the new pass manager.
>From gcc-bugs-return-455003-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 26 10:34:18 2014
Return-Path: <gcc-bugs-return-455003-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30719 invoked by alias); 26 Jun 2014 10:34:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30173 invoked by uid 48); 26 Jun 2014 10:34:11 -0000
From: "dodji at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/60723] Line directives with incorrect system header flag
Date: Thu, 26 Jun 2014 10:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dodji at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: dodji at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-60723-4-03GPv18ptf@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60723-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60723-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg02085.txt.bz2
Content-length: 694

https://gcc.gnu.org/bugzilla/show_bug.cgi?id`723

--- Comment #12 from Dodji Seketeli <dodji at gcc dot gnu.org> ---
Created attachment 33010
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3010&actioníit
A patch candidate that I am currently testing

This the patch I am running through bootstrap at the moment.

The patch basically makes the pre-processor detects changes in system-ness of
tokens and upon each of these change, emits a line marking directive so that
the information about the system-ness change is not lost.

I haven't commented the code yet.

Nicholas, maybe you could test the patch and give me feedback until my (slow)
machine completes the bootstrap?

Thanks.


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2014-06-26 10:17 ` ubizjak at gmail dot com
@ 2014-07-11  7:43 ` uros at gcc dot gnu.org
  2014-07-14 14:09 ` ubizjak at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: uros at gcc dot gnu.org @ 2014-07-11  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from uros at gcc dot gnu.org ---
Author: uros
Date: Fri Jul 11 07:42:50 2014
New Revision: 212449

URL: https://gcc.gnu.org/viewcvs?rev=212449&root=gcc&view=rev
Log:
    PR target/56858
    * config/alpha/alpha.c: Include tree-pass.h, context.h
    and pass_manager.h.
    (pass_data_handle_trap_shadows): New pass.
    (pass_handle_trap_shadows::gate): New pass gate function.
    (make_pass_handle_trap_shadows): New function.
    (rest_of_handle_trap_shadows): Ditto.

    (alpha_align_insns_1): Rename from alpha_align_insns.
    (pass_data_align_insns): New pass.
    (pass_align_insns::gate): New pass gate function.
    (make_pass_aling_insns): New function.
    (rest_of_align_insns): Ditto.
    (alpha_align_insns): Ditto.

    (alpha_option_override): Declare handle_trap_shadows info
    and align_insns_info.  Register handle_trap_shadows and align_insns
    passes here.
    (alpha_reorg): Do not call alpha_trap_shadows and
    alpha_align_insn from here.

    (alpha_pad_function_end): Do not skip BARRIERs.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/alpha/alpha.c


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

* [Bug target/56858] alpha looks for NOTE_INSN_EH_REGION notes that cannot exist
  2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2014-07-11  7:43 ` uros at gcc dot gnu.org
@ 2014-07-14 14:09 ` ubizjak at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: ubizjak at gmail dot com @ 2014-07-14 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.10.0

--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed for 4.10.
>From gcc-bugs-return-456303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jul 14 14:18:20 2014
Return-Path: <gcc-bugs-return-456303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8977 invoked by alias); 14 Jul 2014 14:18:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8728 invoked by uid 48); 14 Jul 2014 14:18:11 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/61800] [4.10 Regression] ICE: Segmentation fault during Firefox build
Date: Mon, 14 Jul 2014 14:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-61800-4-RlEd6qeYnT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61800-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61800-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg00894.txt.bz2
Content-length: 3023

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida800

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.10.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 http % cat TunnelUtils.ii
#pragma GCC visibility push(hidden)
#pragma GCC visibility push(default)
typedef unsigned int uint32_t;
#pragma GCC visibility pop
typedef enum class tag_nsresult : uint32_t
{
  NS_OK = 0,
} nsresult;
typedef int nsIID;
class A
{
public:
  virtual nsresult operator()(const nsIID &, void **) const = 0;
};
template <class T> class B
{
public:
  typedef T element_type;
  B (const A &p1)
  {
    uint32_t __trans_tmp_1;
    void *newRawPtr;
    __trans_tmp_1
        = NS_FAILED_impl (p1 ((T::template D<T, void>::kIID), &newRawPtr));
  }
};

class F : public A
{
  virtual nsresult operator()(const nsIID &p1, void **) const;
};
class G
{
public:
  template <typename T, typename U> struct D;
};
template <typename T> struct G::D<G, T>
{
  static const nsIID kIID __attribute__ ((visibility ("hidden")));
};
class H : public G
{
  virtual nsresult CloseWithStatus (nsresult p1);
};
inline uint32_t NS_FAILED_impl (nsresult p1) {}

inline const F do_QueryReferent (G *p1, nsresult *p2 = 0) {}

nsresult H::CloseWithStatus (nsresult p1)
{
  B<G> baseTrans (do_QueryReferent (0));
  return CloseWithStatus (nsresult::NS_OK);
}


markus@x4 http % /var/tmp/gcc_test/usr/local/bin/c++ -c -O3 -std=c++11
TunnelUtils.ii
TunnelUtils.ii:53:1: internal compiler error: Segmentation fault
 }
 ^
0xb87bff crash_signal
        ../../gcc/gcc/toplev.c:337
0x9f4e46 tree_check
        ../../gcc/gcc/tree.h:2730
0x9f4e46 decl_maybe_in_construction_p(tree_node*, tree_node*,
gimple_statement_base*, tree_node*)
        ../../gcc/gcc/ipa-devirt.c:1974
0x9f5dd1 get_polymorphic_call_info(tree_node*, tree_node*, tree_node**, long*,
ipa_polymorphic_call_context*, gimple_statement_base*)
        ../../gcc/gcc/ipa-devirt.c:2176
0x845414 cgraph_create_indirect_edge(cgraph_node*, gimple_statement_base*, int,
long, int)
        ../../gcc/gcc/cgraph.c:970
0x84e1c1 cgraph_clone_edge(cgraph_edge*, cgraph_node*, gimple_statement_base*,
unsigned int, long, int, bool)
        ../../gcc/gcc/cgraphclones.c:139
0x84ed8e cgraph_clone_node(cgraph_node*, tree_node*, long, int, bool,
vec<cgraph_edge*, va_heap, vl_ptr>, bool, cgraph_node*, bitmap_head*)
        ../../gcc/gcc/cgraphclones.c:473
0x10a97a2 recursive_inlining
        ../../gcc/gcc/ipa-inline.c:1388
0x10a97a2 inline_small_functions
        ../../gcc/gcc/ipa-inline.c:1768
0x10a97a2 ipa_inline
        ../../gcc/gcc/ipa-inline.c:2185
0x10a97a2 execute
        ../../gcc/gcc/ipa-inline.c:2545
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

end of thread, other threads:[~2014-07-14 14:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-06 18:07 [Bug target/56858] New: alpha looks for NOTE_INSN_EH_REGION notes that cannot exist steven at gcc dot gnu.org
2013-04-06 18:09 ` [Bug target/56858] " steven at gcc dot gnu.org
2013-04-06 21:56 ` steven at gcc dot gnu.org
2013-04-07  8:28 ` ubizjak at gmail dot com
2013-04-08  7:38 ` ubizjak at gmail dot com
2013-04-08 14:35 ` rth at gcc dot gnu.org
2013-04-08 15:32 ` steven at gcc dot gnu.org
2013-04-08 15:52 ` rth at gcc dot gnu.org
2013-04-08 18:43 ` steven at gcc dot gnu.org
2013-04-08 19:27 ` rth at gcc dot gnu.org
2013-04-08 19:42 ` stevenb.gcc at gmail dot com
2013-04-08 20:09 ` rth at gcc dot gnu.org
2013-04-21 21:15 ` ubizjak at gmail dot com
2013-04-21 21:36 ` stevenb.gcc at gmail dot com
2014-06-26 10:15 ` ubizjak at gmail dot com
2014-06-26 10:17 ` ubizjak at gmail dot com
2014-07-11  7:43 ` uros at gcc dot gnu.org
2014-07-14 14:09 ` ubizjak at gmail 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).