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


"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:

|  > 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?"

Zack focused on what I think is the less important thing.  I expressed
a concern about the use of "w.s.low" which was left out in his reply.

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

Doing that in two separate statements is fine.  It is doing it in the
initialization that worries me.

|  The new code uses it in one initialization statement,
| however .low is still initialized first so I believe it should be ok.

It should be OK in which sense?

| (It's not evaluated in random order like function arguments, is it?)

Sure

       [#23] The order in which any side effects  occur  among  the
       initialization list expressions is unspecified.130)

and footnote 130) is

       130In  particular, the evaluation order need not be the same
          as the order of subobject initialization.

| 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 would prefer that.

-- Gaby


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