This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATH] fix PR 13087, documentation does not follow IMA/IMI (all at once compiling)
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Geoff Keating <geoffk at geoffk dot org>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Wed, 26 Nov 2003 19:27:58 -0800
- Subject: [PATH] fix PR 13087, documentation does not follow IMA/IMI (all at once compiling)
This patch is make reality matches the documentation and also fixes a
bug in the
process. -save-temps used to not work when using compile at once aka
gcc -c test.c test1.c -o test.o -c -save-temps would cause cc1 to error
out and not produce anything because it would try to preprocess the
source files together (e.g. cc1 -E test.c test1.c -o test.ii).
First I am sorry but I also included a patch to boolize some variables
in gcc.c (some cleanup that
was needed as I was having some problems with variables not being
"bool"), I can split it out if
need be.
I also found a bug in the way -### is handle when it comes to linker
files, the driver warns no
matter what, I will try to see why this is.
This patch does not cause gcc to error out for supplying two files and
"-E", that will be in the next patch.
Bootstrapped and regression tested on powerpc-apple-darwin7.0.0 (also
bootstrapped with
--enable-intermodule).
ChangeLog:
* gcc.c: Every where use false/true instead of FALSE/TRUE.
(save_temps_flag): Boolize.
(build_search_list): Boolize first_time.
(set_collect_gcc_options): Likewise.
(print_multilib_info): Boolize print_at.
PR driver/13087
* gcc.c (default_compilers) <@c>: Do not run cc1 on the
preprocessed source if -save-temps. Do not run the
assembler on the asm if -tranditional-cpp.
(struct infile): Add incompiler, temp_filename, and compiled fields.
(preprocessing): New variable to track when using -save-temps on a
source.
(assembly_input): New variable to track if an inputfile is an assembly
file.
(have_c): New variable.
(have_o): Likewise.
(traditional_cpp_flag): Likewise.
(capital_e_flag): Likewise.
(process_command): Change have_c and have_o to global static variables.
Process also -traditional-cpp and -E.
(do_spec_1): Create new temp file for each source file for all
at once compiling.
Save the temp_filename into infiles's temp_filename.
<case 'i'>: Only do the combine of inputs when not preprocessing
Only add files that have the same language as the input_file_compiler
and that is not a linker flag.
(main): Allow `gcc test.c test1.c -o test' use compile all at once.
Separate out the creation of the intermediate files (fixes all at once
and -save-temps).
Do not lookup the compiler, use the cached one in infiles.
Attachment:
temp.diff.txt
Description: Text document
Thanks,
Andrew Pinski
PS hopefully I did the changelog right :).