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: Fix powerpc64 g77




--On Thursday, August 01, 2002 11:23:16 PM +0200 Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:

Mark Mitchell <mark@codesourcery.com> writes:

[...]

| > Actually, since the path is known at compile time to be dead, I don't
| > think the compiler should be issueing such diagnostic about the
runtime | > behaviour.
|
| I disagree -- and I don't know of any other compilers that work as
| you suggest.

Not just because they aren't working that way means it is OK :-)
True.

| The whole point of using run-time conditionals is to allow the compiler
| to issue errors and warnings about pieces of code that we would
otherwise | not compile -- thereby preventing build failures for people
with | machines different from our own.

Whereas I agree with the general philosohy of the run-time
conditionals, I don't think that in this particular case, the warning
is any meaningful.  It is about the value of an expression in a path
that would never be taken.
If you saw this code:

 if (TARGET_HAS_FOO) {
   x = 1 / 0;
 }

and TARGET_HAS_FOO was 0, wouldn't you want a warning?

I think we should probably just agree to disagree. :-)

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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