This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- From: Ian Lance Taylor <iant at google dot com>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, gcc at gcc dot gnu dot org
- Date: 31 Dec 2006 18:11:50 -0800
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612300047.kBU0lFwk014817@localhost.localdomain> <45970416.80407@adacore.com> <8764bssikm.fsf@penguin.cs.ucla.edu> <571f6b510612310047r3b7ef9acl4a0ab082e88e17a3@mail.gmail.com> <87bqlkmm3r.fsf@penguin.cs.ucla.edu> <4aca3dc20612310641n78e8898euf1c003444e2303eb@mail.gmail.com> <87fyavhphc.fsf@penguin.cs.ucla.edu> <45980B43.7080301@adacore.com> <84fc9c000612311121x2ed1772fya44e59d373f0b57b@mail.gmail.com> <10612311945.AA05131@vlsi1.ultra.nyu.edu> <84fc9c000612311200p72f20f4g62beaa28cf2f920c@mail.gmail.com> <10612312045.AA06726@vlsi1.ultra.nyu.edu> <m38xgnttrj.fsf@localhost.localdomain> <10701010202.AA09735@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
> > > > Note that -fwrapv also _enables_ some transformations on signed
> > > > integers that are disabled otherwise. We for example constant fold
> > > > -CST for -fwrapv while we do not if signed overflow is undefined.
> > > > Would you change those?
> > >
> > > I don't understand the rationale for not wrapping constant folding when
> > > signed overflow is undefined: what's the harm in "defining" it as wrapping
> > > for that purpose? If it's undefined, then why does it matter what we
> > > fold it to? So we might as well fold it to what traditional code expects.
> >
> > If flag_wrapv is false, we can't do any optimization which may
> > introduce signed overflow when it did not already exist.
>
> But how would that happen here? If we constant-fold something that would
> have overflowed by wrapping, we are ELIMINATING a signed overflow, not
> INTRODUCING one. Or do I misunderstand what folding we're talking about here?
http://gcc.gnu.org/PR27116 is what led to the patch.
Ian