aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-10-17 04:22:03 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-10-16 21:22:03 -0700
commitaf41c57d042d6b570c4f5de342e859f71bc67a18 (patch)
tree22064a83d217afbda03a19976677b57f94ac4a54 /gcc
parentd938e4612a745b6fa19fae8f68acbb3e5062cf47 (diff)
downloadgcc-af41c57d042d6b570c4f5de342e859f71bc67a18.zip
gcc-af41c57d042d6b570c4f5de342e859f71bc67a18.tar.gz
gcc-af41c57d042d6b570c4f5de342e859f71bc67a18.tar.bz2
re PR driver/22544 (gcc ignores input file given on the command line)
2005-10-16 Andrew Pinski <pinskia@physics.uc.edu> PR driver/22544 * gcc.c (have_c): New static variable. (have_o): Likewise. (process_command): Remove declation of have_c. Set have_o to 1 when handling -o. (main): Add a fatel error if there are multiple files specified and -o and -c/-S is passed witout -combine or multiple languages. From-SVN: r105487
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/gcc.c13
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6612783..d2d1caf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2005-10-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR driver/22544
+ * gcc.c (have_c): New static variable.
+ (have_o): Likewise.
+ (process_command): Remove declation of have_c.
+ Set have_o to 1 when handling -o.
+ (main): Add a fatel error if there are multiple
+ files specified and -o and -c/-S is passed witout
+ -combine or multiple languages.
+
2005-10-16 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/22444
diff --git a/gcc/gcc.c b/gcc/gcc.c
index bb6d5a1..db0cd0e 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1851,6 +1851,12 @@ static int argbuf_index;
static int have_o_argbuf_index = 0;
+/* Were the options -c or -S passed. */
+static int have_c = 0;
+
+/* Was the option -o passed. */
+static int have_o = 0;
+
/* This is the list of suffixes and codes (%g/%u/%U/%j) and the associated
temp file. If the HOST_BIT_BUCKET is used for %j, no entry is made for
it here. */
@@ -3148,7 +3154,6 @@ process_command (int argc, const char **argv)
char *temp1;
const char *spec_lang = 0;
int last_language_n_infiles;
- int have_c = 0;
int lang_n_infiles = 0;
#ifdef MODIFY_TARGET_NAME
int is_modify_target_name;
@@ -3700,6 +3705,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
goto normal_switch;
case 'o':
+ have_o = 1;
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
if (! have_c)
{
@@ -6425,7 +6431,7 @@ main (int argc, const char **argv)
if (combine_flag)
combine_inputs = true;
else
- combine_inputs = false;
+ combine_inputs = false;
for (i = 0; (int) i < n_infiles; i++)
{
@@ -6456,6 +6462,9 @@ main (int argc, const char **argv)
infiles[i].compiled = false;
infiles[i].preprocessed = false;
}
+
+ if (!combine_inputs && have_c && have_o && n_infiles > 1)
+ fatal ("cannot specify -o with -c or -S with multiple files");
if (combine_flag && save_temps_flag)
{