This is the mail archive of the gcc@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: -Os is weak...


On Thu, Sep 9, 2010 at 6:43 PM, DJ Delorie <dj@redhat.com> wrote:
> $ grep optimize_size *.c
> genconditions.c: ? { "! optimize_size && ! TARGET_READ_MODIFY_WRITE",
> genconditions.c: ? ? __builtin_constant_p (! optimize_size && ! TARGET_READ_MODIFY_WRITE)
> genconditions.c: ? ? ? (int) (! optimize_size && ! TARGET_READ_MODIFY_WRITE)

These are in comments, not actual tests of optimize_size.


> opts.c: ? ? ? optimize_size = 0;
> opts.c: ? ? ? ? ? optimize_size = 0;
> opts.c: ? optimize_size = 1;
> opts.c: ? optimize_size = 0;
> opts.c: ?flag_schedule_insns = opt2 && ! optimize_size;
> opts.c: ?if (optimize_size)
> opts.c: ? ? ?optimize_size = 1;
> opts.c: ?OPTIMIZATION_OPTIONS (optimize, optimize_size);

Various initialization bits for optimize_size, this is OK.


> predict.c: ?if (optimize_size)

This looks like a bug, it should proabably be:

if (optimize_function_for_size_p (DECL_STRUCT_FUNCTION (edge->caller->decl))

Honza, what do you think about this one?


> predict.c: ?return (optimize_size

This is OK, this is inside optimize_function_for_size_p.


> toplev.c: ? The only valid values are zero and nonzero. When optimize_size is
> toplev.c:int optimize_size = 0;
> toplev.c: ?if (flag_prefetch_loop_arrays > 0 && optimize_size)

These are OK.


> tree-inline.c: ?if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO (!optimize_size))

This lacks context to call one of the optimize_*_for_size_p functions.
So this is OK.


> tree-inline.c: ? ?|| (caller_opt->optimize_size != callee_opt->optimize_size))

This is inside an #if 0'ed block and would not be a reference to the
global variable optimize_size anyway. It looks like this code, if
enabled again, would need modifications to make it compile again.


In general, any reference to the global var optimize_size should be
checked to verify that there shouldn't be a more fine-grained check
instead.

Ciao!
Steven


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