public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
@ 2011-07-25  3:15 David Edelsohn
  2011-07-25  8:46 ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: David Edelsohn @ 2011-07-25  3:15 UTC (permalink / raw)
  To: Richard Henderson; +Cc: GCC Patches

This patch set causes a bootstrap failure on AIX:

In file included from /farm/dje/src/src/libgcc/../gcc/unwind-dw2.c:1590:0:
/farm/dje/src/src/libgcc/../gcc/unwind.inc: In function
'_Unwind_RaiseException':
/farm/dje/src/src/libgcc/../gcc/unwind.inc:136:1: internal compiler
error: in maybe_record_trace_start, at dwarf2cfi.c:2433

      /* We ought to have the same state incoming to a given trace no
         matter how we arrive at the trace.  Anything else means we've
         got some kind of optimization error.  */
      gcc_checking_assert (cfi_row_equal_p (cur_row, ti->beg_row));

This is during the stage1 build of libgcc.

- David

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-25  3:15 [RFC PATCH 0/9] CFG aware dwarf2 cfi generation David Edelsohn
@ 2011-07-25  8:46 ` Richard Henderson
  2011-07-25 14:23   ` David Edelsohn
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2011-07-25  8:46 UTC (permalink / raw)
  To: David Edelsohn; +Cc: GCC Patches

On 07/24/2011 06:22 PM, David Edelsohn wrote:
> This patch set causes a bootstrap failure on AIX:
> 
> In file included from /farm/dje/src/src/libgcc/../gcc/unwind-dw2.c:1590:0:
> /farm/dje/src/src/libgcc/../gcc/unwind.inc: In function
> '_Unwind_RaiseException':
> /farm/dje/src/src/libgcc/../gcc/unwind.inc:136:1: internal compiler
> error: in maybe_record_trace_start, at dwarf2cfi.c:2433
> 
>       /* We ought to have the same state incoming to a given trace no
>          matter how we arrive at the trace.  Anything else means we've
>          got some kind of optimization error.  */
>       gcc_checking_assert (cfi_row_equal_p (cur_row, ti->beg_row));
> 
> This is during the stage1 build of libgcc.

Please try again.  I've fixed 4 bugs today for different targets;
hopefully I've gotten this one as part of that.


r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-25  8:46 ` Richard Henderson
@ 2011-07-25 14:23   ` David Edelsohn
  0 siblings, 0 replies; 14+ messages in thread
From: David Edelsohn @ 2011-07-25 14:23 UTC (permalink / raw)
  To: Richard Henderson; +Cc: GCC Patches

On Sun, Jul 24, 2011 at 11:56 PM, Richard Henderson <rth@redhat.com> wrote:

> Please try again.  I've fixed 4 bugs today for different targets;
> hopefully I've gotten this one as part of that.

Unfortunately, no.  Same error.

- David

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-08-04  1:08     ` Andi Kleen
@ 2011-08-04 13:38       ` Jan Hubicka
  0 siblings, 0 replies; 14+ messages in thread
From: Jan Hubicka @ 2011-08-04 13:38 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Jan Hubicka, Richard Henderson, bernds, gcc-patches, tglek

> Jan Hubicka <hubicka@ucw.cz> writes:
> >
> > Cool, will this also help to handle alternate entry points, so we can move ahead
> > on this area we got stuck years ago?  (i.e. add support for alternate entry points on
> > i386 skipping IP pointer load in PIC mode/using register passing conventions)
> 
> Also alternative entry points to skip x87 in favour of SSE 
> register passing for FP would be really nice.

Yep, there is quite some potential in this on x86. On x86-64 also stack
alignment prologues could be eliminated.

I guess the PIC tricks could do wonders for Mozilla. Additionally once this
works, we can move ahead with alternate entry points at gimple level possibly
re-implementing thunks/ctor clonning using them.

So if we finally get past the unwind info issues, I could start poking about
getting the PIC codegen working as a first experiment.

Honza
> 
> -Andi
> 
> -- 
> ak@linux.intel.com -- Speaking for myself only

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-08-03 20:24   ` Jan Hubicka
  2011-08-03 20:26     ` Richard Henderson
@ 2011-08-04  1:08     ` Andi Kleen
  2011-08-04 13:38       ` Jan Hubicka
  1 sibling, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2011-08-04  1:08 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: Richard Henderson, bernds, gcc-patches

Jan Hubicka <hubicka@ucw.cz> writes:
>
> Cool, will this also help to handle alternate entry points, so we can move ahead
> on this area we got stuck years ago?  (i.e. add support for alternate entry points on
> i386 skipping IP pointer load in PIC mode/using register passing conventions)

Also alternative entry points to skip x87 in favour of SSE 
register passing for FP would be really nice.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-08-03 20:26     ` Richard Henderson
@ 2011-08-03 20:33       ` Jan Hubicka
  0 siblings, 0 replies; 14+ messages in thread
From: Jan Hubicka @ 2011-08-03 20:33 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Jan Hubicka, bernds, gcc-patches

> On 08/03/2011 01:24 PM, Jan Hubicka wrote:
> > Cool, will this also help to handle alternate entry points, so we can move ahead
> > on this area we got stuck years ago?  (i.e. add support for alternate entry points on
> > i386 skipping IP pointer load in PIC mode/using register passing conventions)
> 
> I honestly don't remember what happened with the alternate entry points.
> But if it was unwind info, then yes, this will help.

Well, as I remember, the basic infrastructure that allowed to introduce alternate entry points
late in the compilation (i.e. during prologue/epilogue generation) is in.  We just got stuck precisely
on making it working with the unwind info. (as I recall years back, Ihad patches that allowed us
to skip the IP load in PIC mode and planned to follow with the register calling conventions).

This is the -fPIC patch.
http://web.archiveorange.com/archive/v/iv9U0XRCHosZ5bDh6Z6Q
and this is apparently where we got stuck back then.
http://web.archiveorange.com/archive/v/iv9U0byrEj0gzOKGqTtx

Honza
> 
> 
> r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-08-03 20:24   ` Jan Hubicka
@ 2011-08-03 20:26     ` Richard Henderson
  2011-08-03 20:33       ` Jan Hubicka
  2011-08-04  1:08     ` Andi Kleen
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2011-08-03 20:26 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: bernds, gcc-patches

On 08/03/2011 01:24 PM, Jan Hubicka wrote:
> Cool, will this also help to handle alternate entry points, so we can move ahead
> on this area we got stuck years ago?  (i.e. add support for alternate entry points on
> i386 skipping IP pointer load in PIC mode/using register passing conventions)

I honestly don't remember what happened with the alternate entry points.
But if it was unwind info, then yes, this will help.


r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-24  8:23 ` Richard Henderson
  2011-07-24  8:24   ` Bernd Schmidt
@ 2011-08-03 20:24   ` Jan Hubicka
  2011-08-03 20:26     ` Richard Henderson
  2011-08-04  1:08     ` Andi Kleen
  1 sibling, 2 replies; 14+ messages in thread
From: Jan Hubicka @ 2011-08-03 20:24 UTC (permalink / raw)
  To: Richard Henderson; +Cc: bernds, gcc-patches

> On 07/14/2011 04:07 PM, Richard Henderson wrote:
> > This finally brings us to something that can support shrink-wrapping.
> > As mentioned in the description of the last patch, this is 95% of 
> > what Bernd had in his last 007-dw2cfg patch, except for the remember/
> > restore_state stuff.  And hopefully with better comments.
> > 
> > This is the first version of this that has actually made it into
> > stage3 bootstrap on x86_64, so it isn't well tested yet.  This just
> > happens to coincide with the end of my work day, and it's been a while
> > since I've shared state, so I thought I'd post for overnight review.
> 
> I've now committed this entire patch series.
> 
> I will work on generating DW_CFA_remember_state markers next week,

Cool, will this also help to handle alternate entry points, so we can move ahead
on this area we got stuck years ago?  (i.e. add support for alternate entry points on
i386 skipping IP pointer load in PIC mode/using register passing conventions)

Honza

> but what's here now should support anything that your shrink-wrapping
> patches can throw at it.
> 
> Where are we at with the review of the actual shrink-wrap patch set?
> 
> 
> r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-24  8:23 ` Richard Henderson
@ 2011-07-24  8:24   ` Bernd Schmidt
  2011-08-03 20:24   ` Jan Hubicka
  1 sibling, 0 replies; 14+ messages in thread
From: Bernd Schmidt @ 2011-07-24  8:24 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On 07/23/11 22:56, Richard Henderson wrote:
> Where are we at with the review of the actual shrink-wrap patch set?

Richard S. has started reviewing it, and I'm trying to break out some
more preliminary bits and pieces.


Bernd

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-14 23:10 Richard Henderson
  2011-07-15 23:21 ` Richard Henderson
@ 2011-07-24  8:23 ` Richard Henderson
  2011-07-24  8:24   ` Bernd Schmidt
  2011-08-03 20:24   ` Jan Hubicka
  1 sibling, 2 replies; 14+ messages in thread
From: Richard Henderson @ 2011-07-24  8:23 UTC (permalink / raw)
  To: bernds; +Cc: gcc-patches

On 07/14/2011 04:07 PM, Richard Henderson wrote:
> This finally brings us to something that can support shrink-wrapping.
> As mentioned in the description of the last patch, this is 95% of 
> what Bernd had in his last 007-dw2cfg patch, except for the remember/
> restore_state stuff.  And hopefully with better comments.
> 
> This is the first version of this that has actually made it into
> stage3 bootstrap on x86_64, so it isn't well tested yet.  This just
> happens to coincide with the end of my work day, and it's been a while
> since I've shared state, so I thought I'd post for overnight review.

I've now committed this entire patch series.

I will work on generating DW_CFA_remember_state markers next week,
but what's here now should support anything that your shrink-wrapping
patches can throw at it.

Where are we at with the review of the actual shrink-wrap patch set?


r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-16  4:09   ` Bernd Schmidt
@ 2011-07-16  6:07     ` Richard Henderson
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2011-07-16  6:07 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: gcc-patches

On 07/15/2011 04:24 PM, Bernd Schmidt wrote:
> What's wrong with -freorder-blocks-and-partition? Something preexisting,
> or introduced with these changes?

Pre-existing.

The .gcc_except_table format includes a encoded displacement from
a call site to a handler.  We cannot represent this displacement
when the handler and the call site are in different sections.

There is a weak attempt at fixing up this situation in except.c,
convert_to_eh_region_ranges, but (1) the exception data is not
updated, and more importantly, (2) the code that is generated
violates the constraints that are assumed for the exception_receiver
and nonlocal_goto_receiver named patterns.  In particular, targets
like alpha and mips that want to re-compute the GP from some
kind of pc-relative relocation will compute the wrong GP.

The problem appears in the dwarf2 pass only because of (1), in
that when we validate that all extended basic blocks have had
unwind info propagated into them, we find that there are blocks
that are unvisited.

All this cross-segment fixup stuff should have been handled in
pass_partition_blocks, not delayed until it's too late to do
the right thing.

And of course pass_partition_blocks is... well, let's just say
it's due for a bit of maintenance.



r~

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-15 23:21 ` Richard Henderson
@ 2011-07-16  4:09   ` Bernd Schmidt
  2011-07-16  6:07     ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: Bernd Schmidt @ 2011-07-16  4:09 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On 07/16/11 01:08, Richard Henderson wrote:
> On 07/14/2011 04:07 PM, Richard Henderson wrote:
>> This finally brings us to something that can support shrink-wrapping.
>> As mentioned in the description of the last patch, this is 95% of 
>> what Bernd had in his last 007-dw2cfg patch, except for the remember/
>> restore_state stuff.  And hopefully with better comments.
>>
>> This is the first version of this that has actually made it into
>> stage3 bootstrap on x86_64, so it isn't well tested yet.  This just
>> happens to coincide with the end of my work day, and it's been a while
>> since I've shared state, so I thought I'd post for overnight review.
>>
>> The complete tree is available at
>>
>>   git://repo.or.cz/gcc/rth.git rth/cfi-pass
> 
> I've fixed a few minor bugs (mostly silly typos) and pushed the
> update to the external repo.
> 
> All of the x86_64 regressions are fixed except for
> -freorder-blocks-and-partition vs exception handling.
> Which is Very Broken at a fundamental level.

Thanks again for working on this.

What's wrong with -freorder-blocks-and-partition? Something preexisting,
or introduced with these changes?


Bernd

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

* Re: [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
  2011-07-14 23:10 Richard Henderson
@ 2011-07-15 23:21 ` Richard Henderson
  2011-07-16  4:09   ` Bernd Schmidt
  2011-07-24  8:23 ` Richard Henderson
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2011-07-15 23:21 UTC (permalink / raw)
  To: bernds; +Cc: gcc-patches

On 07/14/2011 04:07 PM, Richard Henderson wrote:
> This finally brings us to something that can support shrink-wrapping.
> As mentioned in the description of the last patch, this is 95% of 
> what Bernd had in his last 007-dw2cfg patch, except for the remember/
> restore_state stuff.  And hopefully with better comments.
> 
> This is the first version of this that has actually made it into
> stage3 bootstrap on x86_64, so it isn't well tested yet.  This just
> happens to coincide with the end of my work day, and it's been a while
> since I've shared state, so I thought I'd post for overnight review.
> 
> The complete tree is available at
> 
>   git://repo.or.cz/gcc/rth.git rth/cfi-pass

I've fixed a few minor bugs (mostly silly typos) and pushed the
update to the external repo.

All of the x86_64 regressions are fixed except for
-freorder-blocks-and-partition vs exception handling.
Which is Very Broken at a fundamental level.

I guess I'll be re-writing all that next...


r~

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

* [RFC PATCH 0/9] CFG aware dwarf2 cfi generation
@ 2011-07-14 23:10 Richard Henderson
  2011-07-15 23:21 ` Richard Henderson
  2011-07-24  8:23 ` Richard Henderson
  0 siblings, 2 replies; 14+ messages in thread
From: Richard Henderson @ 2011-07-14 23:10 UTC (permalink / raw)
  To: bernds; +Cc: gcc-patches

This finally brings us to something that can support shrink-wrapping.
As mentioned in the description of the last patch, this is 95% of 
what Bernd had in his last 007-dw2cfg patch, except for the remember/
restore_state stuff.  And hopefully with better comments.

This is the first version of this that has actually made it into
stage3 bootstrap on x86_64, so it isn't well tested yet.  This just
happens to coincide with the end of my work day, and it's been a while
since I've shared state, so I thought I'd post for overnight review.

The complete tree is available at

  git://repo.or.cz/gcc/rth.git rth/cfi-pass


r~


Richard Henderson (9):
  dwarf2cfi: Introduce a dw_cfi_row state.
  dwarf2cfi: Rename cfi_insn to add_cfi_insn.
  dwarf2cfi: Populate CUR_ROW->REG_SAVE.
  dwarf2cfi: Implement change_cfi_row.
  dwarf2cfi: Remove dw_cfi_row_ref typedef.
  dwarf2cfi: Convert queued_reg_save to a VEC.
  dwarf2cfi: Allocate reg_saved_in_data in the heap.
  dwarf2cfi: Introduce dw_trace_info.
  dwarf2cfi: Generate and connect traces.

 gcc/dwarf2cfi.c | 1672 ++++++++++++++++++++++++++++++-------------------------
 gcc/dwarf2out.c |  159 ++++--
 gcc/dwarf2out.h |    5 +-
 3 files changed, 1030 insertions(+), 806 deletions(-)

-- 
1.7.6

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

end of thread, other threads:[~2011-08-04 13:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-25  3:15 [RFC PATCH 0/9] CFG aware dwarf2 cfi generation David Edelsohn
2011-07-25  8:46 ` Richard Henderson
2011-07-25 14:23   ` David Edelsohn
  -- strict thread matches above, loose matches on Subject: below --
2011-07-14 23:10 Richard Henderson
2011-07-15 23:21 ` Richard Henderson
2011-07-16  4:09   ` Bernd Schmidt
2011-07-16  6:07     ` Richard Henderson
2011-07-24  8:23 ` Richard Henderson
2011-07-24  8:24   ` Bernd Schmidt
2011-08-03 20:24   ` Jan Hubicka
2011-08-03 20:26     ` Richard Henderson
2011-08-03 20:33       ` Jan Hubicka
2011-08-04  1:08     ` Andi Kleen
2011-08-04 13:38       ` Jan Hubicka

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