* gcc/config/dsp16xx/dsp16xx.h contains inconsistant OPTIMIZATION_OPTIONS
@ 1998-07-04 18:53 Carlo Wood
1998-07-06 22:11 ` Jeffrey A Law
0 siblings, 1 reply; 2+ messages in thread
From: Carlo Wood @ 1998-07-04 18:53 UTC (permalink / raw)
To: egcs
In gcc/toplev.c line 3829 till 3875, the only place where
OPTIMIZATION_OPTIONS is "called":
-------------------------------------------------------------------------------
if (optimize >= 1)
{
flag_defer_pop = 1;
flag_thread_jumps = 1;
#ifdef DELAY_SLOTS
flag_delayed_branch = 1;
#endif
#ifdef CAN_DEBUG_WITHOUT_FP
flag_omit_frame_pointer = 1;
#endif
}
if (optimize >= 2)
{
flag_cse_follow_jumps = 1;
flag_cse_skip_blocks = 1;
flag_gcse = 1;
flag_expensive_optimizations = 1;
flag_strength_reduce = 1;
flag_rerun_cse_after_loop = 1;
flag_rerun_loop_opt = 1;
flag_caller_saves = 1;
flag_force_mem = 1;
#ifdef INSN_SCHEDULING
flag_schedule_insns = 1;
flag_schedule_insns_after_reload = 1;
#endif
flag_regmove = 1;
/* We don't set flag_strict_aliasing here because we're still
testing the functionality. After it has been tested, it
should be turned on here. */
}
if (optimize >= 3)
{
flag_inline_functions = 1;
}
/* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
modify it. */
target_flags = 0;
set_target_switch ("");
#ifdef OPTIMIZATION_OPTIONS
/* Allow default optimizations to be specified on a per-machine basis. */
OPTIMIZATION_OPTIONS (optimize, optimize_size);
#endif
-------------------------------------------------------------------------------
In gcc/config/dsp16xx/dsp16xx.h we have:
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
{ \
flag_gnu_linker = FALSE; \
\
if (LEVEL) \
{ \
flag_omit_frame_pointer = TRUE; \
flag_thread_jumps = TRUE; \
} \
\
if (LEVEL >= 2) \
{ \
if (! SIZE) \
flag_strength_reduce = TRUE; \
flag_cse_follow_jumps = TRUE; \
flag_cse_skip_blocks = TRUE; \
flag_expensive_optimizations = TRUE; \
flag_rerun_cse_after_loop = TRUE; \
} \
\
if ((LEVEL >= 3) && ! SIZE) \
{ \
flag_inline_functions = 1; \
} \
}
This macro is completely without any effect: It never sets variables that
are not already set and it never resets variables (except flag_gnu_linker).
It seems more logically to me to change it to:
#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
do { \
flag_gnu_linker = 0; \
\
if (SIZE) \
{ \
flag_strength_reduce = 0; \
flag_inline_functions = 0; \
} \
} while(0)
That is, if it is really wanted to reset `flag_strength_reduce' and
`flag_inline_functions' when `optimize_size' is set.
Shall I make a path for this?
--
Carlo Wood <carlo@runaway.xs4all.nl>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gcc/config/dsp16xx/dsp16xx.h contains inconsistant OPTIMIZATION_OPTIONS
1998-07-04 18:53 gcc/config/dsp16xx/dsp16xx.h contains inconsistant OPTIMIZATION_OPTIONS Carlo Wood
@ 1998-07-06 22:11 ` Jeffrey A Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 1998-07-06 22:11 UTC (permalink / raw)
To: Carlo Wood; +Cc: egcs
In message < 199807050055.CAA27477@jolan.ppro >you write:
> In gcc/toplev.c line 3829 till 3875, the only place where
> OPTIMIZATION_OPTIONS is "called":
Right.
> In gcc/config/dsp16xx/dsp16xx.h we have:
[ ... ]
OK. Looks like nobody ever cleaned dsp16xx up. No suprise since few
folks use the dsp16xx port.
> This macro is completely without any effect: It never sets variables that
> are not already set and it never resets variables (except flag_gnu_linker).
>
> It seems more logically to me to change it to:
>
> #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
> do { \
> flag_gnu_linker = 0; \
> \
> if (SIZE) \
> { \
> flag_strength_reduce = 0; \
> flag_inline_functions = 0; \
> } \
> } while(0)
>
> That is, if it is really wanted to reset `flag_strength_reduce' and
> `flag_inline_functions' when `optimize_size' is set.
I believe that is correct.
> Shall I make a path for this?
It would be greatly appreciated. Thanks!
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-07-06 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-04 18:53 gcc/config/dsp16xx/dsp16xx.h contains inconsistant OPTIMIZATION_OPTIONS Carlo Wood
1998-07-06 22:11 ` Jeffrey A Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).