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: Question on -Werror usage in Makefiles...


 > From: "Zack Weinberg" <zack@codesourcery.com>
 > 
 > Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
 > 
 > > "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
 > >
 > > | +  const DWunion uu = {.ll = u};
 > > | +  const DWunion w = { {.low = -uu.s.low,
 > > | +		       .high = -uu.s.high - ((UWtype) w.s.low > 0) } };
 > >
 > > I thought these constructs are only C99...
 > 
 > Perfectly ok to use C99 constructs in libgcc2.c as long as gcc
 > properly implements them.
 > zw

Perfectly ok, as in "ok to install?"

The patch survived bootstrap and testsuite on solaris2 last night.
Apparently the extra "const"s allow slightly better optimization
because two of the functions reduced in size.  (_negdi2.o by 16 bytes
and _udivmoddi4.o by 8 bytes.)


Regarding the use of w.s.low as Gaby mentioned, the original code did
the same thing, however it did so it two separate statements, with
w.s.low first.  The new code uses it in one initialization statement,
however .low is still initialized first so I believe it should be ok.
(It's not evaluated in random order like function arguments, is it?)
If that's a problem, or even a perceived one, I can substitute the
actual value instead of using .low in that case.  (And I'll retest.)

I'd also like to hear from Joern whether it solves the "uninitialized"
warnings.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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