1 /* Subroutines for GNU compiler for Intel 80x86 running DG/ux
2 Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
3 Currently maintained by (gcc@dg-rtp.dg.com)
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
23 #include "i386/i386.c"
26 extern char *version_string;
37 output_option (file, sep, type, name, indent, pos, max)
46 if (strlen (sep) + strlen (type) + strlen (name) + pos > max)
48 fprintf (file, indent);
49 return fprintf (file, "%s%s", type, name);
51 return pos + fprintf (file, "%s%s%s", sep, type, name);
54 static struct { char *name; int value; } m_options[] = TARGET_SWITCHES;
57 output_options (file, f_options, f_len, W_options, W_len,
58 pos, max, sep, indent, term)
60 struct option *f_options;
61 struct option *W_options;
71 pos = output_option (file, sep, "-O", "", indent, pos, max);
72 if (write_symbols != NO_DEBUG)
73 pos = output_option (file, sep, "-g", "", indent, pos, max);
74 /* if (flag_traditional)
75 pos = output_option (file, sep, "-traditional", "", indent, pos, max);*/
77 pos = output_option (file, sep, "-p", "", indent, pos, max);
78 if (profile_block_flag)
79 pos = output_option (file, sep, "-a", "", indent, pos, max);
81 for (j = 0; j < f_len; j++)
82 if (*f_options[j].variable == f_options[j].on_value)
83 pos = output_option (file, sep, "-f", f_options[j].string,
86 for (j = 0; j < W_len; j++)
87 if (*W_options[j].variable == W_options[j].on_value)
88 pos = output_option (file, sep, "-W", W_options[j].string,
91 for (j = 0; j < sizeof m_options / sizeof m_options[0]; j++)
92 if (m_options[j].name[0] != '\0'
93 && m_options[j].value > 0
94 && ((m_options[j].value & target_flags)
95 == m_options[j].value))
96 pos = output_option (file, sep, "-m", m_options[j].name,
99 pos = output_option (file, sep, "-mcpu=", ix86_cpu_string, indent, pos, max);
100 pos = output_option (file, sep, "-march=", ix86_arch_string, indent, pos, max);
101 fprintf (file, term);
104 /* Output to FILE the start of the assembler file. */
107 output_file_start (file, f_options, f_len, W_options, W_len)
109 struct option *f_options;
110 struct option *W_options;
115 output_file_directive (file, main_input_filename);
116 fprintf (file, "\t.version\t\"01.01\"\n"); \
117 /* Switch to the data section so that the coffsem symbol and the
118 gcc2_compiled. symbol aren't in the text section. */
121 pos = fprintf (file, "\n// cc1 (%s) arguments:", VERSION_STRING);
122 output_options (file, f_options, f_len, W_options, W_len,
123 pos, 75, " ", "\n// ", "\n\n");
125 #ifdef TARGET_IDENTIFY_REVISION
126 if (TARGET_IDENTIFY_REVISION)
130 time_t now = time ((time_t *)0);
131 sprintf (indent, "]\"\n\t%s\t \"@(#)%s [", IDENT_ASM_OP, main_input_filename);
132 fprintf (file, indent+3);
133 pos = fprintf (file, "gcc %s, %.24s,", VERSION_STRING, ctime (&now));
134 output_options (file, f_options, f_len, W_options, W_len,
135 pos, 150 - strlen (indent), " ", indent, "]\"\n\n");
137 #endif /* TARGET_IDENTIFY_REVISION */
140 #ifndef CROSS_COMPILE
141 #if defined (_abort_aux)
142 /* Debugging aid to be registered via `atexit'. See the definition
143 of abort in dgux.h. */
157 if (write_symbols != NO_DEBUG)
159 for (line_note = (rtx) insn_ ; line_note != 0 ; line_note = PREV_INSN (line_note))
160 if (GET_CODE (line_note) == NOTE && NOTE_LINE_NUMBER (line_note) > 0)
164 error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
165 NOTE_LINE_NUMBER (line_note),
166 "Internal gcc abort from %s:%d",
167 file_ ? file_ : "<nofile>", line_);
168 if (insn_ && file_ && strcmp (file_, "toplev.c"))
170 error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
171 NOTE_LINE_NUMBER (line_note),
172 "The local variable `insn' has the value:", 0);
173 debug_rtx ((rtx) insn_);
177 if (write_symbols == NO_DEBUG || line_note == 0)
179 error ("Internal gcc abort from %s:%d",
180 file_ ? file_ : "<nofile>", line_);
181 if (insn_ && file_ && strcmp (file_, "toplev.c"))
183 error ("The local variable `insn' has the value:", 0);
184 debug_rtx ((rtx) insn_);