[PATCH] PR21604: Correctly remove OptimizeForSize from OptimizeNone functions

Robinson, Paul Paul_Robinson at playstation.sony.com
Mon Nov 24 12:53:26 PST 2014


> -----Original Message-----
> From: aaron.ballman at gmail.com [mailto:aaron.ballman at gmail.com] On Behalf
> Of Aaron Ballman
> Sent: Monday, November 24, 2014 11:07 AM
> To: Robinson, Paul
> Cc: cfe-commits at cs.uiuc.edu
> Subject: Re: [PATCH] PR21604: Correctly remove OptimizeForSize from
> OptimizeNone functions
> 
> On Mon, Nov 24, 2014 at 12:55 PM, Robinson, Paul
> <Paul_Robinson at playstation.sony.com> wrote:
> > Ping. Aaron, could you PTAL?
> 
> Patch LGTM, 

r222683, thanks!

> but I would like to see a follow-up patch that warns when
> optnone causes other attributes the user has written to be ignored.

OptimizeForSize and MinSize only come from -Os/-Oz, they aren't "written"
so no warning needed there.  It does look like when you have separate
decl and def, with optnone on one and always_inline on another, there's
no diagnostic; that probably deserves one. Although it's less clear when
optnone is in effect because of a pragma.

I'll put this on my to-do list for next week.
--paulr

> 
> ~Aaron
> 
> > --paulr
> >
> >> -----Original Message-----
> >> From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-
> >> bounces at cs.uiuc.edu] On Behalf Of Robinson, Paul
> >> Sent: Wednesday, November 19, 2014 5:22 PM
> >> To: cfe-commits at cs.uiuc.edu
> >> Subject: [PATCH] PR21604: Correctly remove OptimizeForSize from
> >> OptimizeNone functions
> >>
> >> While it might have looked like OptimizeNone removed the
> OptimizeForSize
> >> attribute from a function, it weren't necessarily so.  This patch fixes
> >> the attribute handling so 'optnone' correctly supersedes all the other
> >> things it's supposed to supersede.
> >>
> >> Updated a test to do a -Os run so we verify that part works right.
> >> Added a test to exercise different combinations of attributes on the
> >> declaration versus on the definition, which is another way that these
> >> things can end up having to be merged/untangled.
> >> --paulr
> >




More information about the cfe-commits mailing list