gcc/gcc
Zack Weinberg ef89d648b8 optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
	* genopinit.c: Put floating point divide insns in sdiv_optab.
	* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
	* config/gofast.h, config/c4x/c4x.h,
	config/ia64/hpux_longdouble.h, config/mips/mips.h,
	config/pa/long_double.h, config/rs6000/sysv4.h,
	config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
	* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
	(init_optabs): Use init_optabv for overflow-trapping optabs.
	Don't init flodiv_optab.  Give mov_optab, movstrict_optab, and
	cmp_optab RTX codes so have_insn_for can find them.

	* optabs.c (expand_simple_binop, expand_simple_unop,
	have_insn_for, gen_sub3_insn): New interfaces.
	* expr.h: Prototype new functions.
	(enum optab_methods): Move here from optabs.h.

	* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
	loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
	Use new	functions instead of working directly with optabs.
	* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
	unroll.c: Don't include optabs.h.
	* caller-save.c, combine.c, function.c, stmt.c: Just include
	insn-codes.h, not optabs.h.
	* Makefile.in: Update dependencies.

	* combine.c (make_compound_operation, simplify_comparison):
	Fix typos testing for this or that instruction.

From-SVN: r45008
2001-08-18 19:59:46 +00:00
..
ch except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
config optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
cp except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
doc (Install GCC): Add links to build status pages. 2001-08-17 22:21:49 +00:00
f Daily bump. 2001-08-18 07:16:42 +00:00
fixinc extra casting required by new pointer type 2001-07-21 04:20:08 +00:00
ginclude eabi.asm: Define 64-bit versions of FPR save/restore routines. 2001-08-13 13:37:17 -04:00
intl * gettextP.h (SWAP): Change parameter type to unsigned int. 2001-07-06 14:32:49 -07:00
java defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
objc except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
po cpperror.c (print_containing_files): Moved to line-map.c. 2001-08-06 21:07:41 +00:00
testsuite pr3743.x: Do not return 1 for xfail. 2001-08-16 20:18:00 +00:00
.cvsignore Add cscope(1) databases 2001-08-15 04:52:54 +00:00
ABOUT-GCC-NLS
ABOUT-NLS
acconfig.h
aclocal.m4 For PR java/2812: 2001-07-18 17:17:03 +00:00
alias.c alias.c (get_alias_set): Return a previously calculated alias set for a VAR_DECL. 2001-08-08 12:56:51 -04:00
basic-block.h Makefile.in (reload1.o): Add dedendancy on except.h 2001-08-05 23:39:21 -07:00
bb-reorder.c basic-block.h (EDGE_FREQUENCY): New macro. 2001-07-28 21:37:35 +00:00
bitmap.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
bitmap.h bitmap.c: Comment some functions; fiddle whitespace. 2001-07-11 10:34:48 -07:00
build-make Add CFLAGS_FOR_BUILD for canadian cross build. 2001-06-27 21:38:51 -07:00
builtin-types.def builtins.def: Encode additional information, such as names and types, here. 2001-05-25 20:00:59 +00:00
builtins.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
builtins.def builtins.def: Fix definition of __builtin_cosf, it uses float as parameter and return value. 2001-06-05 18:02:56 +02:00
c-aux-info.c c-aux-info.c: NULL_PTR->NULL in calls to `concat'. 2001-04-29 12:43:20 +00:00
c-common.c target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. 2001-08-03 18:31:41 -07:00
c-common.def
c-common.h c-common.h (RETURN_NULLIFIED_P): Lose. 2001-08-10 10:01:33 -04:00
c-convert.c
c-decl.c Move constructor/destructor handling into target hooks. 2001-08-09 15:33:35 -07:00
c-dump.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
c-dump.h c-common.h (flag_dump_translation_unit): Remove. 2001-06-05 08:03:45 +00:00
c-errors.c
c-format.c
c-lang.c * c-lang.c (start_cdtor): Remove extra parameter from start_function. 2001-07-09 14:36:15 -04:00
c-lex.c c-lex.c (map): Make const. 2001-08-11 07:33:39 +00:00
c-lex.h Standardize header guards. 2001-05-25 18:31:47 -07:00
c-parse.in toplev.c (set_float_handler): Make static. 2001-08-12 01:56:10 +00:00
c-pragma.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
c-pragma.h c-pragma.h (HANDLE_PRAGMA_WEAK): Define iff ASM_WEAKEN_LABEL and ASM_OUTPUT_WEAK_ALIAS are defined. 2001-07-17 12:55:19 +00:00
c-semantics.c c-common.h (RETURN_NULLIFIED_P): Lose. 2001-08-10 10:01:33 -04:00
c-tree.h regmove.c (replace_in_call_usage): Fix warnings. 2001-07-10 12:38:10 +02:00
c-typeck.c c-typeck.c (RESTORE_SPELLING_DEPTH): Uppercase and parenthesize macro parameter. 2001-08-08 07:00:45 +00:00
caller-save.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
calls.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
ChangeLog optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
ChangeLog.0
ChangeLog.1
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5 Rotate ChangeLog. 2001-07-02 14:23:53 -06:00
ChangeLog.lib
collect2.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
collect2.h Standardize header guards. 2001-05-25 18:31:47 -07:00
combine.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
conditions.h
config.gcc config.gcc: Use t-slibgcc-elf to build shared libgcc_s on s390*linux. 2001-08-13 17:33:12 +02:00
config.guess
config.in For PR java/2812: 2001-07-18 17:17:03 +00:00
configure Move constructor/destructor handling into target hooks. 2001-08-09 15:33:35 -07:00
configure.frag
configure.in Move constructor/destructor handling into target hooks. 2001-08-09 15:33:35 -07:00
conflict.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
convert.c
convert.h
COPYING
COPYING.LIB
cppdefault.c
cppdefault.h Standardize header guards. 2001-05-25 18:31:47 -07:00
cpperror.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cppexp.c cppexp.c (EXTRACT_PRIO): Uppercase and parenthsize macro parameter. 2001-08-09 13:14:57 +00:00
cppfiles.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cpphash.c cpphash.c (_cpp_destroy_hashtable): Use ht_destroy. 2001-08-11 12:37:19 +00:00
cpphash.h cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cppinit.c cppinit.c (init_standard_includes): Reverse accidentally included hunk from prefix.c patch. 2001-08-18 07:17:14 +00:00
cpplex.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cpplib.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cpplib.h cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cppmacro.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cppmain.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
cppspec.c alias.c: Fix comment formatting. 2001-08-01 17:57:27 +00:00
cross-make i * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file. 2001-05-17 03:16:18 +00:00
crtstuff.c varasm.c (assemble_variable): Don't overalign if DECL_USER_ALIGN. 2001-08-17 11:28:06 -07:00
cse.c toplev.c (set_float_handler): Make static. 2001-08-12 01:56:10 +00:00
cselib.c toplev.c (set_float_handler): Make static. 2001-08-12 01:56:10 +00:00
cselib.h Make cselib_subst_to_values global. 2001-08-08 10:38:57 +00:00
cstamp-h.in
dbxout.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
dbxout.h Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. 2001-07-19 21:17:09 +00:00
dbxstclass.h
debug.c Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. 2001-07-19 21:17:09 +00:00
debug.h Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. 2001-07-19 21:17:09 +00:00
defaults.h defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
dependence.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
df.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
df.h Makefile.in (OBJS): Add df.o 2001-06-28 16:11:19 -06:00
diagnostic.c final.c (shorten_branches): Clear the end of the label_align array only if we made it larger. 2001-08-17 01:27:49 +00:00
diagnostic.def diagnostic.def: New file. 2001-05-01 08:19:45 +00:00
diagnostic.h diagnostic.h (diagnostic_format_decoder): Parenthesize macro parameter. 2001-08-08 08:10:58 +00:00
doloop.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
dominance.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
doprint.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
doschk.c
dostage2
dostage3
dwarf2.h dwarf2.h: Add dwarf 2.1 tags/attributes/etc to the enums. 2001-06-29 16:52:08 +00:00
dwarf2asm.c defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
dwarf2asm.h except.c (eh_data_format_name): Move to ... 2001-05-16 15:42:36 -07:00
dwarf2out.c varasm.c (text_section): Allow TEXT_SECTION to override the printing of TEXT_SECTION_ASM_OP. 2001-08-17 11:57:51 -07:00
dwarf2out.h Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. 2001-07-19 21:17:09 +00:00
dwarf.h
dwarfout.c defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
emit-rtl.c dbxout.c: Fix comment formatting. 2001-08-08 22:06:48 +00:00
enquire.c
errors.c rtl.def (DEFINE_INSN, [...]): Change output-template slot to format 'T'. 2001-06-30 17:23:53 +00:00
errors.h Standardize header guards. 2001-05-25 18:31:47 -07:00
except.c except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
except.h except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of DWARF2_UNWIND_INFO not just whether it is defined. 2001-07-06 16:13:42 -07:00
exgettext
explow.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
expmed.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
expr.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
expr.h optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
final.c defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
fix-header.c cpperror.c (print_location): Don't take a file name; use the line map instead. 2001-08-17 22:23:49 +00:00
fixproto
flags.h c-decl.c (init_decl_processing): Don't call start_identifier_warnings. 2001-05-27 21:04:28 +00:00
floatlib.c i * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file. 2001-05-17 03:16:18 +00:00
flow.c rtl.h (only_sets_cc0_p): New prototype. 2001-08-15 19:25:43 +00:00
fold-const.c toplev.c (set_float_handler): Make static. 2001-08-12 01:56:10 +00:00
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
function.h integrate.c (ggc.h): Include. 2001-06-21 12:50:56 -04:00
future.options
gbl-ctors.h
gcc.c gcc.c (init_spec): Revert last patch by Theodore Papadopoulo, the english is correct. 2001-08-13 18:41:20 +02:00
gcc.h Revert Rainer Orth's Java and gcc.c patch. 2001-08-12 16:36:22 -04:00
gcc.hlp
gccbug.in gccbug.in: Fix typo. 2001-06-05 18:38:44 +00:00
gccspec.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
gcov-io.h predict.c (estimate_bb_frequencies): Do not handle conditional jumps jumping to fallthru basic block as conditional... 2001-06-22 17:23:14 +00:00
gcov.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
gcse.c gcse.c (hash_scan_set): Expressions that are set as part of jump instructions are not available. 2001-08-13 21:42:10 +00:00
gdbinit.in
gen-protos.c
genattr.c
genattrtab.c genattrtab.c (simplify_test_exp_in_temp): New function. 2001-08-14 13:01:20 +00:00
gencheck.c
gencodes.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
genconfig.c
genconstants.c Makefile.in (HOST_CFLAGS): Take out -DGENERATOR_FILE. 2001-08-09 17:11:00 +00:00
genemit.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
genextract.c
genflags.c
gengenrtl.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
genmultilib
genopinit.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
genoutput.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
genpeep.c c-lex.c: NULL_PTR -> NULL. 2001-05-02 14:31:45 +00:00
genpreds.c Makefile.in (HOST_CFLAGS): Take out -DGENERATOR_FILE. 2001-08-09 17:11:00 +00:00
genrecog.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
gensupport.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
gensupport.h
ggc-callbacks.c
ggc-common.c
ggc-none.c
ggc-page.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
ggc-simple.c
ggc.h Makefile.in (OBJS, [...]): Update. 2001-05-20 06:26:45 +00:00
glimits.h Remove s390x __LONG_MAX__ special case from glimits.h; 2001-08-14 00:53:23 +00:00
global.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
gmon.c
graph.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
graph.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gstab.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gsyms.h
gsyslimits.h cppinit.c (cpp_post_options): Shut off macro expansion if -fpreprocessed. 2001-05-10 00:07:23 +00:00
gthr-aix.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gthr-dce.h gthr-dce.h (__GTHREAD_MUTEX_INIT_FUNCTION and __GTHREAD_MUTEX_INIT_DEFAULT): New macros for mutex initialization. 2001-08-03 22:13:22 +00:00
gthr-posix.h Fixed backend function of objc_mutex_trylock which was broken 2001-07-18 11:21:20 +00:00
gthr-rtems.h configure.in: Add rtems as a supported thread model. 2001-07-24 18:44:29 -07:00
gthr-single.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gthr-solaris.h gthr-posix.h (__gthread_active_ptr): Cast function pointer to target type to allow ISO C++ compiler to accept it. 2001-05-30 22:38:43 +00:00
gthr-vxworks.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gthr-win32.h Standardize header guards. 2001-05-25 18:31:47 -07:00
gthr.h Standardize header guards. 2001-05-25 18:31:47 -07:00
haifa-sched.c calls.c (expand_call): Do not emit INSN_SETJMP note. 2001-08-07 20:24:08 +00:00
halfpic.c
halfpic.h
hard-reg-set.h hard-reg-set.h (regs_invalidated_by_call): Declare. 2001-07-16 10:54:34 -07:00
hash.c i386.c (ix86_emit_restore_regs_using_mov, [...]): Change bool' parameter to int'. 2001-05-04 14:36:39 +00:00
hash.h i386.c (ix86_emit_restore_regs_using_mov, [...]): Change bool' parameter to int'. 2001-05-04 14:36:39 +00:00
hashtable.c cpphash.c (_cpp_destroy_hashtable): Use ht_destroy. 2001-08-11 12:37:19 +00:00
hashtable.h cpphash.c (_cpp_destroy_hashtable): Use ht_destroy. 2001-08-11 12:37:19 +00:00
hwint.h Standardize header guards. 2001-05-25 18:31:47 -07:00
ifcvt.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
input.h
insn-addr.h insn-addr.h (INSN_ADDRESSES_NEW): Make insn_uid__ unsigned. 2001-06-03 22:58:08 +00:00
integrate.c rtl.h (only_sets_cc0_p): New prototype. 2001-08-15 19:25:43 +00:00
integrate.h integrate.c (ggc.h): Include. 2001-06-21 12:50:56 -04:00
intl.c
intl.h
jump.c rtl.h (only_sets_cc0_p): New prototype. 2001-08-15 19:25:43 +00:00
LANGUAGES
lcm.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
libfuncs.h expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
libgcc2.c * libgcc2.c (*): Replace EH_FRAME_SECTION with EH_FRAME_SECTION_NAME. 2001-08-14 14:06:10 +00:00
libgcc2.h Standardize header guards. 2001-05-25 18:31:47 -07:00
libgcc-std.ver Makefile.in: Move _bb and __gcc_bcmp to LIB2FUNCS_ST. 2001-06-13 14:26:03 +00:00
limitx.h
limity.h cppinit.c (cpp_post_options): Shut off macro expansion if -fpreprocessed. 2001-05-10 00:07:23 +00:00
line-map.c c-lex.c (map): Make const. 2001-08-11 07:33:39 +00:00
line-map.h c-lex.c (map): Make const. 2001-08-11 07:33:39 +00:00
listing
lists.c
local-alloc.c alias.c (nonlocal_mentioned_p): Rename CONST_CALL_P to CONST_OR_PURE_CALL_P 2001-08-07 12:59:58 +00:00
longlong.h i * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file. 2001-05-17 03:16:18 +00:00
loop.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
loop.h loop.h (struct movables): Remove `num'. 2001-05-11 15:54:19 +00:00
machmode.def machmode.def (Pmode): Redefine if GENERATOR_FILE. 2001-07-15 17:28:20 -07:00
machmode.h
main.c
make-l2.com
Makefile.in optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
makefile.vms
mbchar.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
mbchar.h Standardize header guards. 2001-05-25 18:31:47 -07:00
mips-tdump.c c-lex.c: NULL_PTR -> NULL. 2001-05-02 14:31:45 +00:00
mips-tfile.c osf.h (ASM_OUTPUT_WEAK_ALIAS, [...]): Define. 2001-07-19 18:08:17 +00:00
mkconfig.sh expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
mkdeps.c mkdeps.c (deps_add_default_target): Make local variable ``start'' a const char pointer. 2001-08-03 15:42:25 +00:00
mkdeps.h Standardize header guards. 2001-05-25 18:31:47 -07:00
mkinstalldirs
mklibgcc.in mklibgcc.in: Prefer LIB1ASMFUNCS over LIB2_DIVMOD_FUNCS when generating libgcc.a. 2001-08-18 11:16:08 -07:00
mkmap-flat.awk
mkmap-symver.awk
move-if-change
ONEWS
optabs.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
optabs.h optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
output.h defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
params.c
params.def params.def (PARAM_MAX_INLINE_INSNS): Change default to 600. 2001-08-02 07:52:31 +00:00
params.h params.def (PARAM_MAX_PENDING_LIST_LENGTH): Add parameter to limit length of dependancy flush list. 2001-07-26 13:59:22 +00:00
patch-apollo-includes
predict.c * predict.def: Update hitrates. 2001-08-15 11:24:17 +00:00
predict.def predict.c (struct block_info_def): Remove nvisited. 2001-08-15 12:28:46 +00:00
predict.h basic-block.h (EDGE_FREQUENCY): New macro. 2001-07-28 21:37:35 +00:00
prefix.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
prefix.h Standardize header guards. 2001-05-25 18:31:47 -07:00
print-rtl.c rtl.c (copy_rtx): Handle 'T' format letter. 2001-07-03 19:23:35 +00:00
print-tree.c print-tree.c (print_node): Don't print "regdecl" when bit doesn't mean that; use proper names instead. 2001-06-02 06:56:44 -04:00
profile.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
protoize.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
read-rtl.c * read-rtl.c (read_name): Consider \r whitespace. 2001-08-01 13:49:24 -07:00
README-fixinc reorganize inclhacks and apply fix to fixtests.c 2001-05-27 18:21:04 +00:00
README.Portability
real.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
real.h Makefile.in (final.o): Depend on target.h. 2001-07-06 18:40:17 +00:00
recog.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
recog.h recog.h (struct insn_operand_data): Shrink 'mode' field to 16 bits. 2001-08-13 04:22:58 +00:00
reg-stack.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
regclass.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
regmove.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
regrename.c regrename.c (regrename_optimize): Compute nregs for each potential target register. 2001-07-22 00:10:46 -07:00
regs.h flow.c (mark_set_1): Use REG_FREQ_FROM_BB. 2001-07-30 20:03:37 +00:00
reload1.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
reload.c expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
reload.h expr.h: Split out optab- and libfunc-related code to... 2001-08-13 15:56:51 +00:00
reorg.c tm.texi (MD_CAN_REDIRECT_BRANCH): New macro. 2001-07-23 16:00:06 +00:00
resource.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
resource.h
rtl-error.c Makefile.in (OBJS): Add rtl-error.o 2001-08-14 19:22:48 +00:00
rtl.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
rtl.def rtl.def (DEFINE_INSN, [...]): Change output-template slot to format 'T'. 2001-06-30 17:23:53 +00:00
rtl.h system.h: Forward-declare struct rtx_def, struct rtvec_def, and union tree_node. 2001-08-17 20:29:21 +00:00
rtlanal.c gcc.c: Fix comment formatting. 2001-08-12 23:40:53 +00:00
sbitmap.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
sbitmap.h [multiple changes] 2001-07-29 18:21:08 +00:00
scan-decls.c Makefile.in (CPPLIB_H): New, so that dependencies on cpplib.h are also on line-map.h. 2001-08-04 12:01:59 +00:00
scan-types.sh
scan.c
scan.h
sched-deps.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
sched-ebb.c Use cselib for alias analysis in sched_ebb 2001-08-08 10:36:07 +00:00
sched-int.h Use cselib for alias analysis in sched_ebb 2001-08-08 10:36:07 +00:00
sched-rgn.c Use cselib for alias analysis in sched_ebb 2001-08-08 10:36:07 +00:00
sched-vis.c sched-vis.c (MAX_VISUAL_NO_UNIT): Define. 2001-08-09 13:32:57 +00:00
sdbout.c dbxout.c (dbxout_global_decl): New. 2001-07-22 17:02:53 +00:00
sdbout.h Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. 2001-07-19 21:17:09 +00:00
SERVICE
sibcall.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
simplify-rtx.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
sort-protos
ssa-ccp.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
ssa-dce.c basic-block.h (first_insn_after_basic_block_note): Declare. 2001-07-06 12:19:47 -06:00
ssa.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
ssa.h ssa-ccp.c (first_phi_node): Remove. 2001-07-10 10:27:54 -06:00
stab.def
stack.h
stmt.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
stor-layout.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
stringpool.c c-decl.c (init_decl_processing): Don't call start_identifier_warnings. 2001-05-27 21:04:28 +00:00
sys-protos.h Makefile.in: Exterminate all references to assert.h. 2001-05-11 17:03:02 +00:00
sys-types.h
system.h system.h: Forward-declare struct rtx_def, struct rtvec_def, and union tree_node. 2001-08-17 20:29:21 +00:00
target-def.h Move constructor/destructor handling into target hooks. 2001-08-09 15:33:35 -07:00
target.h varasm.c (named_section_flags): Remove align parameter. 2001-08-16 19:33:41 -07:00
timevar.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
timevar.def basic-block.h (CLEANUP_PRE_SIBCALL): New constant. 2001-07-16 20:54:44 +00:00
timevar.h final.c (shorten_branches): Clear the end of the label_align array only if we made it larger. 2001-08-17 01:27:49 +00:00
tlink.c tlink.c (scan_linker_output): Check string for unsatisfied in addition to undefined and unresolved. 2001-08-14 11:01:48 -04:00
toplev.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
toplev.h toplev.c (set_float_handler): Make static. 2001-08-12 01:56:10 +00:00
tradcif.y re PR preprocessor/3824 (With -traditional, CPP 0xffffffff > 0 but C 0xffffffff < 0) 2001-08-05 21:31:30 +00:00
tradcpp.c cppinit.c (cpp_post_options): Shut off macro expansion if -fpreprocessed. 2001-05-10 00:07:23 +00:00
tradcpp.h Standardize header guards. 2001-05-25 18:31:47 -07:00
tree.c except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
tree.def *** empty log message *** 2001-07-31 19:28:43 -07:00
tree.h except.c (TYPE_HASH): Delete. 2001-08-18 18:11:18 +00:00
tsystem.h Standardize header guards. 2001-05-25 18:31:47 -07:00
typeclass.h
unprotoize.c
unroll.c optabs.h (OTI_flodiv, [...]): Kill. 2001-08-18 19:59:46 +00:00
unwind-dw2-fde.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
unwind-dw2-fde.h unwind-dw2-fde.c (__deregister_frame_info): Stubbify in favour of... 2001-05-22 16:01:33 -07:00
unwind-dw2.c sbitmap.c: Fix comment formatting. 2001-08-17 21:23:12 +00:00
unwind-pe.h unwind-pe.h (base_of_encoded_value, [...]): Define only if NO_BASE_OF_ENCODED_VALUE isn't defined. 2001-08-01 21:18:42 +02:00
unwind-sjlj.c unwind-sjlj.c (_Unwind_GetDataRelBase): New. 2001-05-15 20:08:28 -07:00
unwind.h defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. 2001-05-11 23:03:20 -07:00
unwind.inc except.c (dw2_build_landing_pads): Use word_mode, not Pmode, as ncessary. 2001-05-20 00:35:24 +00:00
varasm.c defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ... 2001-08-17 17:53:20 -07:00
varray.c varray.c: Include errors.h for internal_error and trim_filename declarations. 2001-07-09 22:30:41 +02:00
varray.h varray.h (VARRAY_TOP_GENERIC_PTR): Remove spurious parameter. 2001-07-04 19:40:02 +00:00
version.c Daily bump. 2001-08-18 07:16:42 +00:00
version.h Standardize header guards. 2001-05-25 18:31:47 -07:00
vmsconfig.com
xcoffout.c dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. 2001-07-17 19:47:58 +00:00
xcoffout.h dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. 2001-07-17 19:47:58 +00:00

Copyright (C) 2000 Free Software Foundation, Inc.

This file is intended to contain a few notes about writing C code
within GCC so that it compiles without error on the full range of
compilers GCC needs to be able to compile on.

The problem is that many ISO-standard constructs are not accepted by
either old or buggy compilers, and we keep getting bitten by them.
This knowledge until know has been sparsely spread around, so I
thought I'd collect it in one useful place.  Please add and correct
any problems as you come across them.

I'm going to start from a base of the ISO C89 standard, since that is
probably what most people code to naturally.  Obviously using
constructs introduced after that is not a good idea.

The first section of this file deals strictly with portability issues,
the second with common coding pitfalls.


			Portability Issues
			==================

Unary +
-------

K+R C compilers and preprocessors have no notion of unary '+'.  Thus
the following code snippet contains 2 portability problems.

int x = +2;  /* int x = 2;  */
#if +1       /* #if 1  */
#endif


Pointers to void
----------------

K+R C compilers did not have a void pointer, and used char * as the
pointer to anything.  The macro PTR is defined as either void * or
char * depending on whether you have a standards compliant compiler or
a K+R one.  Thus

  free ((void *) h->value.expansion);

should be written

  free ((PTR) h->value.expansion);

Further, an initial investigation indicates that pointers to functions
returning void are okay.  Thus the example given by "Calling functions
through pointers to functions" below appears not to cause a problem.


String literals
---------------

Some SGI compilers choke on the parentheses in:-

const char string[] = ("A string");

This is unfortunate since this is what the GNU gettext macro N_
produces.  You need to find a different way to code it.

K+R C did not allow concatenation of string literals like

  "This is a " "single string literal".

Moreover, some compilers like MSVC++ have fairly low limits on the
maximum length of a string literal; 509 is the lowest we've come
across.  You may need to break up a long printf statement into many
smaller ones.


Empty macro arguments
---------------------

ISO C (6.8.3 in the 1990 standard) specifies the following:

If (before argument substitution) any argument consists of no
preprocessing tokens, the behavior is undefined.

This was relaxed by ISO C99, but some older compilers emit an error,
so code like

#define foo(x, y) x y
foo (bar, )

needs to be coded in some other way.


signed keyword
--------------

The signed keyword did not exist in K+R compilers; it was introduced
in ISO C89, so you cannot use it.  In both K+R and standard C,
unqualified char and bitfields may be signed or unsigned.  There is no
way to portably declare signed chars or signed bitfields.

All other arithmetic types are signed unless you use the 'unsigned'
qualifier.  For instance, it is safe to write

  short paramc;

instead of

  signed short paramc;

If you have an algorithm that depends on signed char or signed
bitfields, you must find another way to write it before it can be
integrated into GCC.


Function prototypes
-------------------

You need to provide a function prototype for every function before you
use it, and functions must be defined K+R style.  The function
prototype should use the PARAMS macro, which takes a single argument.
Therefore the parameter list must be enclosed in parentheses.  For
example,

int myfunc PARAMS ((double, int *));

int
myfunc (var1, var2)
	double var1;
	int *var2;
{
  ...
}

You also need to use PARAMS when referring to function protypes in
other circumstances, for example see "Calling functions through
pointers to functions" below.

Variable-argument functions are best described by example:-

void cpp_ice PARAMS ((cpp_reader *, const char *msgid, ...));

void
cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...))
{  
#ifndef ANSI_PROTOTYPES
  cpp_reader *pfile;
  const char *msgid;
#endif
  va_list ap;
  
  VA_START (ap, msgid);
  
#ifndef ANSI_PROTOTYPES
  pfile = va_arg (ap, cpp_reader *);
  msgid = va_arg (ap, const char *);
#endif

  ...
  va_end (ap);
}

For the curious, here are the definitions of the above macros.  See
ansidecl.h for the definitions of the above macros and more.

#define PARAMS(paramlist)  paramlist  /* ISO C.  */
#define VPARAMS(args)   args

#define PARAMS(paramlist)  ()         /* K+R C.  */
#define VPARAMS(args)   (va_alist) va_dcl

One aspect of using K+R style function declarations, is you cannot
have arguments whose types are char, short, or float, since without
prototypes (ie, K+R rules), these types are promoted to int, int, and
double respectively.

Calling functions through pointers to functions
-----------------------------------------------

K+R C compilers require parentheses around the dereferenced function
pointer expression in the call, whereas ISO C relaxes the syntax.  For
example

typedef void (* cl_directive_handler) PARAMS ((cpp_reader *, const char *));
      *p->handler (pfile, p->arg);

needs to become

      (*p->handler) (pfile, p->arg);


Macros
------

The rules under K+R C and ISO C for achieving stringification and
token pasting are quite different.  Therefore some macros have been
defined which will get it right depending upon the compiler.

  CONCAT2(a,b) CONCAT3(a,b,c) and CONCAT4(a,b,c,d)

will paste the tokens passed as arguments.  You must not leave any
space around the commas.  Also,

  STRINGX(x)

will stringify an argument; to get the same result on K+R and ISO
compilers x should not have spaces around it.


Passing structures by value
---------------------------

Avoid passing structures by value, either to or from functions.  It
seems some K+R compilers handle this differently or not at all.


Enums
-----

In K+R C, you have to cast enum types to use them as integers, and
some compilers in particular give lots of warnings for using an enum
as an array index.


Bitfields
---------

See also "signed keyword" above.  In K+R C only unsigned int bitfields
were defined (i.e. unsigned char, unsigned short, unsigned long.
Using plain int/short/long was not allowed).


free and realloc
----------------

Some implementations crash upon attempts to free or realloc the null
pointer.  Thus if mem might be null, you need to write

  if (mem)
    free (mem);


Reserved Keywords
-----------------

K+R C has "entry" as a reserved keyword, so you should not use it for
your variable names.


Type promotions
---------------

K+R used unsigned-preserving rules for arithmetic expresssions, while
ISO uses value-preserving.  This means an unsigned char compared to an
int is done as an unsigned comparison in K+R (since unsigned char
promotes to unsigned) while it is signed in ISO (since all of the
values in unsigned char fit in an int, it promotes to int).

Trigraphs
---------

You weren't going to use them anyway, but trigraphs were not defined
in K+R C, and some otherwise ISO C compliant compilers do not accept
them.


Suffixes on Integer Constants
-----------------------------

K+R C did not accept a 'u' suffix on integer constants.  If you want
to declare a constant to be be unsigned, you must use an explicit
cast.

You should never use a 'l' suffix on integer constants ('L' is fine),
since it can easily be confused with the number '1'.


			Common Coding Pitfalls
			======================

errno
-----

errno might be declared as a macro.


Implicit int
------------

In C, the 'int' keyword can often be omitted from type declarations.
For instance, you can write

  unsigned variable;

as shorthand for

  unsigned int variable;

There are several places where this can cause trouble.  First, suppose
'variable' is a long; then you might think

  (unsigned) variable

would convert it to unsigned long.  It does not.  It converts to
unsigned int.  This mostly causes problems on 64-bit platforms, where
long and int are not the same size.

Second, if you write a function definition with no return type at
all:

  operate(a, b)
      int a, b;
  {
    ...
  }

that function is expected to return int, *not* void.  GCC will warn
about this.  K+R C has no problem with 'void' as a return type, so you
need not worry about that.

Implicit function declarations always have return type int.  So if you
correct the above definition to

  void
  operate(a, b)
      int a, b;
  ...

but operate() is called above its definition, you will get an error
about a "type mismatch with previous implicit declaration".  The cure
is to prototype all functions at the top of the file, or in an
appropriate header.

Char vs unsigned char vs int
----------------------------

In C, unqualified 'char' may be either signed or unsigned; it is the
implementation's choice.  When you are processing 7-bit ASCII, it does
not matter.  But when your program must handle arbitrary binary data,
or fully 8-bit character sets, you have a problem.  The most obvious
issue is if you have a look-up table indexed by characters.

For instance, the character '\341' in ISO Latin 1 is SMALL LETTER A
WITH ACUTE ACCENT.  In the proper locale, isalpha('\341') will be
true.  But if you read '\341' from a file and store it in a plain
char, isalpha(c) may look up character 225, or it may look up
character -31.  And the ctype table has no entry at offset -31, so
your program will crash.  (If you're lucky.)

It is wise to use unsigned char everywhere you possibly can.  This
avoids all these problems.  Unfortunately, the routines in <string.h>
take plain char arguments, so you have to remember to cast them back
and forth - or avoid the use of strxxx() functions, which is probably
a good idea anyway.

Another common mistake is to use either char or unsigned char to
receive the result of getc() or related stdio functions.  They may
return EOF, which is outside the range of values representable by
char.  If you use char, some legal character value may be confused
with EOF, such as '\377' (SMALL LETTER Y WITH UMLAUT, in Latin-1).
The correct choice is int.

A more subtle version of the same mistake might look like this:

  unsigned char pushback[NPUSHBACK];
  int pbidx;
  #define unget(c) (assert(pbidx < NPUSHBACK), pushback[pbidx++] = (c))
  #define get(c) (pbidx ? pushback[--pbidx] : getchar())
  ...
  unget(EOF);

which will mysteriously turn a pushed-back EOF into a SMALL LETTER Y
WITH UMLAUT.


Other common pitfalls
---------------------

o Expecting 'plain' char to be either sign or unsigned extending

o Shifting an item by a negative amount or by greater than or equal to
  the number of bits in a type (expecting shifts by 32 to be sensible
  has caused quite a number of bugs at least in the early days).

o Expecting ints shifted right to be sign extended.

o Modifying the same value twice within one sequence point.

o Host vs. target floating point representation, including emitting NaNs
  and Infinities in a form that the assembler handles.

o qsort being an unstable sort function (unstable in the sense that
  multiple items that sort the same may be sorted in different orders
  by different qsort functions).

o Passing incorrect types to fprintf and friends.

o Adding a function declaration for a module declared in another file to
  a .c file instead of to a .h file.