+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
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. */
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;
goto normal_switch;
case 'o':
+ have_o = 1;
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
if (! have_c)
{
if (combine_flag)
combine_inputs = true;
else
- combine_inputs = false;
+ combine_inputs = false;
for (i = 0; (int) i < n_infiles; i++)
{
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)
{