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: [PATCH] Fix %< handling in the driver (PR driver/42442)


Jakub Jelinek writes:
 > Hi!
 > 
 > The addition of -fcompare-debug in r148271 regressed -march=native when used
 > with multiple files (and other %< options in that case).
 > check_live_switch used to ignore SWITCH_IGNORE bit, but since r148271 it
 > says that those options aren't live.
 > When we have multiple source files, do_spec containing among others
 > %{march=native:%<march=native %:local_cpu_detect(arch)}
 > is invoked for each source file.  On the first file march=native is
 > considered live, thus the condition is true and %<march=native sets
 > SWITCH_IGNORE bit on that option (and %: adds various options to
 > argbuf).  But on the next file check_live_switch for march=native
 > returns newly false because SWITCH_IGNORE bit is set, thus march=native
 > condition is considered false and nothing is expanded from its body.
 > 
 > The reason for the r148271 change in check_live_switch has been to
 > fix behaviour of do_self_spec when encountering %<.  do_self_spec appends
 > the argbuf accumulated options at the end of switches, so switches
 > ignored through %< in self specs really should be ignored permanently -
 > their replacements have been added to switches and every do_spec afterwards
 > will see all those switches.  But do_spec invocations can be called multiple
 > times and we shouldn't consider switches not being present on the command
 > line just because an earlier do_spec invocation saw that switch in %<.
 > 
 > This patch implements that, %< in do_self_spec means that the option isn't
 > considered by check_live_switch afterwards, %< seen in do_spec is considered
 > like it used to be before r148271.
 > 
 > Ok for trunk?
 > 
 > 2009-12-22  Jakub Jelinek  <jakub@redhat.com>
 > 
 > 	PR driver/42442
 > 	* gcc.c (SWITCH_IGNORE_PERMANENTLY): Define.
 > 	(do_self_spec): For switches with SWITCH_IGNORE set set also
 > 	SWITCH_IGNORE_PERMANENTLY.
 > 	(check_live_switch): Check SWITCH_IGNORE_PERMANENTLY instead
 > 	of SWITCH_IGNORE.

This caused
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44095

/Mikael


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