aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>2000-08-21 12:01:51 -0600
committerJeff Law <law@gcc.gnu.org>2000-08-21 12:01:51 -0600
commit49009afdf737a82926f3f3a245508ef6db51c33e (patch)
treecb0efe07a757f09a75c26e74d5e3d29b0e63d2fa /gcc/toplev.c
parentdc13bad72b60849788b55675d3ded5674b7dbdc8 (diff)
downloadgcc-49009afdf737a82926f3f3a245508ef6db51c33e.zip
gcc-49009afdf737a82926f3f3a245508ef6db51c33e.tar.gz
gcc-49009afdf737a82926f3f3a245508ef6db51c33e.tar.bz2
gcc.c (do_spec_1): Implement %j spec flag.
* gcc.c (do_spec_1): Implement %j spec flag. Remove dead comment. * gcc.texi (The Configuration File): Document HOST_BIT_BUCKET. * system.h (HOST_BIT_BUCKET): Default to "/dev/null". * config/i386/xm-dos.h (HOST_BIT_BUCKET): Define as "NUL". * config/i386/xm-os2.h, config/winnt/winnt.h: Likewise. * protoize.c (munge_compile_params): Use HOST_BIT_BUCKET (if writable) instead of hardcoded value. * toplev.c (compile_file): Output to a file even if -fsyntax-only. * gcc.c, config/i386/xm-dos.h, config/i386/xm-os2.h: Kill MKTEMP_EACH_FILE. * gcc.c (cc1_options): Do not process -o or run the assembler if -fsyntax-only. From-SVN: r35849
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index bff4b31..225549a 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2127,38 +2127,35 @@ compile_file (name)
pfatal_with_name (aux_info_file_name);
}
- /* Open assembler code output file. */
+ /* Open assembler code output file. Do this even if -fsyntax-only is on,
+ because then the driver will have provided the name of a temporary
+ file or bit bucket for us. */
- if (flag_syntax_only)
- asm_out_file = NULL;
+ if (! name_specified && asm_file_name == 0)
+ asm_out_file = stdout;
else
{
- if (! name_specified && asm_file_name == 0)
- asm_out_file = stdout;
+ if (asm_file_name == 0)
+ {
+ int len = strlen (dump_base_name);
+ char *dumpname = (char *) xmalloc (len + 6);
+ memcpy (dumpname, dump_base_name, len + 1);
+ strip_off_ending (dumpname, len);
+ strcat (dumpname, ".s");
+ asm_file_name = dumpname;
+ }
+ if (!strcmp (asm_file_name, "-"))
+ asm_out_file = stdout;
else
- {
- if (asm_file_name == 0)
- {
- int len = strlen (dump_base_name);
- char *dumpname = (char *) xmalloc (len + 6);
- memcpy (dumpname, dump_base_name, len + 1);
- strip_off_ending (dumpname, len);
- strcat (dumpname, ".s");
- asm_file_name = dumpname;
- }
- if (!strcmp (asm_file_name, "-"))
- asm_out_file = stdout;
- else
- asm_out_file = fopen (asm_file_name, "w");
- if (asm_out_file == 0)
- pfatal_with_name (asm_file_name);
- }
+ asm_out_file = fopen (asm_file_name, "w");
+ if (asm_out_file == 0)
+ pfatal_with_name (asm_file_name);
+ }
#ifdef IO_BUFFER_SIZE
- setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
- _IOFBF, IO_BUFFER_SIZE);
+ setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
+ _IOFBF, IO_BUFFER_SIZE);
#endif
- }
if (ggc_p && name != 0)
name = ggc_alloc_string (name, strlen (name));
@@ -2427,8 +2424,7 @@ compile_file (name)
finish_parse ();
- if (! flag_syntax_only
- && (ferror (asm_out_file) != 0 || fclose (asm_out_file) != 0))
+ if (ferror (asm_out_file) != 0 || fclose (asm_out_file) != 0)
fatal_io_error (asm_file_name);
/* Do whatever is necessary to finish printing the graphs. */