This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR optimization/12324


> > On Thu, 16 Oct 2003 01:24:30 +0200, Jan Hubicka <jh@suse.cz> wrote:
> > 
> > > this is updated patch for the PR.  Now the constructor is elliminated in
> > > both unit and non-unit-at-a-time mode.
> > >
> > > !       /* By using GCC extension we may produce constructors we never use,
> > > !          so ensure that the function is not emit unless it is needed.  */
> > > !       if (flag_unit_at_a_time)
> > > !         DECL_DEFER_OUTPUT (decl) = 1;
> > 
> > How is it eliminated in non-unit-at-a-time mode?
> 
> Oops, I re-typed the patch as I lost original and the test is supposed
> to be other way around.  With flag_unit_at_a_time we must not deffer
> while normally we must.
> Funilly enought this makes no difference on testsuite...

Hi,
hope that this time I really got it right :)
It bootstrapped/regtested and fixes the testcase.

Honza

2003-10-16  Jan Hubicka  <jh@suse.cz>
	PR optimization/12324
	* c-decl.c (build_compound_literal): Do not deffer constructor in unit-at-a-time
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.454
diff -c -3 -p -r1.454 c-decl.c
*** c-decl.c	4 Oct 2003 16:49:26 -0000	1.454
--- c-decl.c	15 Oct 2003 23:22:54 -0000
*************** build_compound_literal (tree type, tree 
*** 3088,3094 ****
  			       compound_literal_number);
        compound_literal_number++;
        DECL_NAME (decl) = get_identifier (name);
!       DECL_DEFER_OUTPUT (decl) = 1;
        DECL_COMDAT (decl) = 1;
        DECL_ARTIFICIAL (decl) = 1;
        pushdecl (decl);
--- 3088,3098 ----
  			       compound_literal_number);
        compound_literal_number++;
        DECL_NAME (decl) = get_identifier (name);
! 
!       /* By using GCC extension we may produce constructors we never use,
!          so ensure that the function is not emit unless it is needed.  */
!       if (!flag_unit_at_a_time)
!         DECL_DEFER_OUTPUT (decl) = 1;
        DECL_COMDAT (decl) = 1;
        DECL_ARTIFICIAL (decl) = 1;
        pushdecl (decl);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]