* cpphash.h (struct lexer_state): Add directive_wants_padding.
* cpplib.c (_cpp_handle_directive): Set directive_wants_padding
for directives of type INCL.
(glue_header_name, parse_include): Use get_token_no_padding.
* cppmacro.c (replace_args): If directive_wants_padding,
provide padding tokens.
* testsuite/gcc.dg/cpp/include3.c: New test.
* testsuite/gcc.dg/cpp/inc/foo.h: New file.
From-SVN: r63231
+2003-02-21 Zack Weinberg <zack@codesourcery.com>
+
+ * cpphash.h (struct lexer_state): Add directive_wants_padding.
+ * cpplib.c (_cpp_handle_directive): Set directive_wants_padding
+ for directives of type INCL.
+ (glue_header_name, parse_include): Use get_token_no_padding.
+ * cppmacro.c (replace_args): If directive_wants_padding,
+ provide padding tokens.
+
2003-02-21 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (a peephole2): New.
2003-02-20 David Edelsohn <edelsohn@gnu.org>
- * config/rs6000/sysv4.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define.
- * config/rs6000/power4.md (power4-store,power4-vecstore): New
+ * config/rs6000/sysv4.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define.
+ * config/rs6000/power4.md (power4-store,power4-vecstore): New
insn reservations.
(power4-fpstore): Compact.
* fixinc/inclhack.def (irix_wcsftime): Use XPG5 variant for C99.
* fixinc/tests/base/internal/wchar_core.h: New file.
-
+
* fixinc/inclhack.def (irix_socklen_t): Fix broken IRIX 6.5.1[78]
socklen_t definition.
* fixinc/fixincl.x: Regenerate.
2003-02-18 Matt Austern <austern@apple.com>
* toplev.c, langhooks.c, langhooks-def.h: Move
- write_global_declarations from toplev.c to langhooks.c.
+ write_global_declarations from toplev.c to langhooks.c.
2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
2003-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
- * config/sh/sh.c (unspec_caller_rtx_p): New.
+ * config/sh/sh.c (unspec_caller_rtx_p): New.
(sh_cannot_copy_insn_p): New.
- (TARGET_CANNOT_COPY_INSN_P): New.
+ (TARGET_CANNOT_COPY_INSN_P): New.
2003-02-18 Richard Henderson <rth@redhat.com>
* c-common.c (handle_used_attribute): Accept static data too.
2003-02-18 Nick Clifton <nickc@redhat.com>
- Aldy Hernandez <aldyh@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
- * testsuite/gcc.dg/20030218-1.c: New.
+ * testsuite/gcc.dg/20030218-1.c: New.
- * doc/tm.texi: Document TARGET_VECTOR_TYPES_COMPATIBLE.
+ * doc/tm.texi: Document TARGET_VECTOR_TYPES_COMPATIBLE.
- * target-def.h (TARGET_INITIALIZER): Add
- TARGET_VECTOR_TYPES_COMPATIBLE.
- (TARGET_VECTOR_TYPES_COMPATIBLE): New macro.
+ * target-def.h (TARGET_INITIALIZER): Add
+ TARGET_VECTOR_TYPES_COMPATIBLE.
+ (TARGET_VECTOR_TYPES_COMPATIBLE): New macro.
- * target.h (struct gcc_target): Add field vector_types_compatible.
+ * target.h (struct gcc_target): Add field vector_types_compatible.
- * c-typeck.c (comptypes): Take into account
- TARGET_VECTOR_TYPES_COMPATIBLE.
- (convert_for_assignment): Same.
+ * c-typeck.c (comptypes): Take into account
+ TARGET_VECTOR_TYPES_COMPATIBLE.
+ (convert_for_assignment): Same.
- * config/rs6000/rs6000.c (is_ev64_opaque_type): New.
- (rs6000_spe_vector_types_compatible): New.
- (TARGET_VECTOR_TYPES_COMPATIBLE): Define.
+ * config/rs6000/rs6000.c (is_ev64_opaque_type): New.
+ (rs6000_spe_vector_types_compatible): New.
+ (TARGET_VECTOR_TYPES_COMPATIBLE): Define.
2003-02-19 Andreas Schwab <schwab@suse.de>
(*extendhisi2_h8300): Likewise.
2003-02-18 Matt Austern <austern@apple.com>
-
+
* langhooks.h, langhooks-def.h: introduce new langhook,
final_write_globals, with write_global_declarations as default.
* toplev.c: Move invocation of wrapup_global_declarations from
compile_file to new function, write_global_declarations. Change
compile_file to use final_write_globals hook. Change
wrapup_global_declarations so writing to DECL_DEFER_OUTPUT is
- conditional.
-
+ conditional.
+
2003-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.md: Correct and enhance comment.
2003-02-17 Aldy Hernandez <aldyh@redhat.com>
- * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg.
- (__ev_stdw): Same.
- (__ev_stdh): Same.
+ * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg.
+ (__ev_stdw): Same.
+ (__ev_stdh): Same.
Mon Feb 17 16:16:54 CET 2003 Jan Hubicka <jh@suse.cz>
* function.h (struct function): Add computed_goto_common_label,
computed_goto_common_reg.
* function.c (free_after_compilation): Zap them.
- * stmt.c (expand_computed_goto): Use them to produce one
+ * stmt.c (expand_computed_goto): Use them to produce one
indirect branch per function.
2003-02-15 Richard Henderson <rth@redhat.com>
2003-02-15 Richard Henderson <rth@redhat.com>
- * recog.c (split_all_insns): Include new blocks in life update;
- do a global life update.
+ * recog.c (split_all_insns): Include new blocks in life update;
+ do a global life update.
2003-02-15 Danny Smith <dannysmith@users.sourceforge.net>
2003-02-13 Adam Nemet <anemet@lnxw.com>
- PR opt/2391
+ PR opt/2391
* combine.c: Fix spelling in comment.
(cached_nonzero_bits): New function.
(cached_num_sign_bit_copies): New function.
/* Nonzero if first token on line is CPP_HASH. */
unsigned char in_directive;
+ /* Nonzero if in a directive that will handle padding tokens itself.
+ #include needs this to avoid problems with computed include and
+ spacing between tokens. */
+ unsigned char directive_wants_padding;
+
/* True if we are skipping a failed conditional group. */
unsigned char skipping;
skipping or not, we should lex angle-bracketed headers
correctly, and maybe output some diagnostics. */
pfile->state.angled_headers = dir->flags & INCL;
+ pfile->state.directive_wants_padding = dir->flags & INCL;
if (! CPP_OPTION (pfile, preprocessed))
directive_diagnostics (pfile, dir, indented);
if (pfile->state.skipping && !(dir->flags & COND))
buffer = (unsigned char *) xmalloc (capacity);
for (;;)
{
- token = cpp_get_token (pfile);
+ token = get_token_no_padding (pfile);
if (token->type == CPP_GREATER || token->type == CPP_EOF)
break;
dir = pfile->directive->name;
/* Allow macro expansion. */
- header = cpp_get_token (pfile);
+ header = get_token_no_padding (pfile);
if (header->type != CPP_STRING && header->type != CPP_HEADER_NAME)
{
if (header->type != CPP_LESS)
count = arg->expanded_count, from = arg->expanded;
/* Padding on the left of an argument (unless RHS of ##). */
- if (!pfile->state.in_directive
+ if ((!pfile->state.in_directive || pfile->state.directive_wants_padding)
&& src != macro->exp.tokens && !(src[-1].flags & PASTE_LEFT))
*dest++ = padding_token (pfile, src);
+2003-02-21 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.dg/cpp/include3.c: New test.
+ * gcc.dg/cpp/inc/foo.h: New file.
+
2003-02-21 Glen Nakamura <glen@imodulo.com>
* gcc.c-torture/execute/20030221-1.c: New test.
2003-02-18 Aldy Hernandez <aldyh@redhat.com>
- * gcc.dg/20030218-1.c: New.
+ * gcc.dg/20030218-1.c: New.
2003-02-18 Richard Henderson <rth@redhat.com>
PR c++/9704
* g++.dg/init/copy5.C: New test.
-
+
2003-02-18 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pch/pch.exp: Delete $bname.h before copying into it.
2003-02-12 Aldy Hernandez <aldyh@redhat.com>
- * gcc.dg/ppc-spe.c: Fix formatting.
- Enable tests that were previously unsupported by gas.
- Delete tests for instructions that no longer exist.
- Switch arguments on evsubifw builtin.
+ * gcc.dg/ppc-spe.c: Fix formatting.
+ Enable tests that were previously unsupported by gas.
+ Delete tests for instructions that no longer exist.
+ Switch arguments on evsubifw builtin.
2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
STACK_SIZE is too small.
2003-02-10 Eric Botcazou <ebotcazou@libertysurf.fr>
- Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+ Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
* gcc.dg/decl-2.c: New test.
2003-01-28 D.Venkatasubramanian <dvenkat@noida.hcltech.com>
- * gcc.c-torture/execute/20010925-1.c: Changed the
- memcpy declaration.
+ * gcc.c-torture/execute/20010925-1.c: Changed the
+ memcpy declaration.
2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9403
* g++.dg/parse/template3.C: New test.
* g++.old-deja/g++.pt/memclass5.C: Add needed template keyword.
-
+
PR c++/795
* g++.dg/parse/template4.C: New test.
-
+
PR c++/9415
* g++.dg/template/qual2.C: New test.
-
+
PR c++/8545
* g++.old-deja/g++.brendan/parse3.C: Remove XFAIL.
PR c++/9294:
* g++.dg/parse/qualified1.C: New test.
-
+
* g++.dg/parse/typename3.C: New test.
2003-01-16 Richard Henderson <rth@redhat.com>
* gcc/testsuite/g++.old-deja/g++.pt/typename19.C: Remove warning.
* gcc/testsuite/g++.old-deja/g++.robertl/eb112.C: Fix typo.
* gcc/testsuite/g++.old-deja/g++.robertl/eb24.C: Use this->.
-
+
2003-01-16 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/ambig2.C: New test.
* gcc.dg/pch/pch.exp: Compare .s files with/without PCH,
rather than trying to build and run a program using PCH.
* gcc.dg/pch: Remove dg-do commands from test files.
-
+
2002-11-08 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pch/macro-3.c: New.
* g++.old-deja/g++.mike/p9706.C: Likewise
* g++.old-deja/g++.mike/p10416.C: Likewise
* g++.old-deja/g++.mike/p11667.C: Likewise
- * g77.f-torture/compile/20010519-1.f: Remove reference to Convex.
+ * g77.f-torture/compile/20010519-1.f: Remove reference to Convex.
Remove redundant reference to Iris.
* gcc.dg/20020312-2.c: Remove references to AMD A29K, Clipper, Convex,
Elxsi, i860, Pico Java, and WE32K.
2002-12-31 Mark Mitchell <mark@codesourcery.com>
* g++.dg/parse/namespace1.C: New test.
-
+
2003-01-01 Neil Booth <neil@daikokuya.co.uk>
* g++.dg/parse/parse4.C: New test.
* g++.old-deja/g++.pt/memtemp87.C: Add missing access specifier.
* g++.old-deja/g++.pt/overload13.C: Correct error messages.
* g++.old-deja/g++.pt/parms2.C: Add missing typename keyword.
- * g++.old-deja/g++.pt/ptrmem1.C: Remove invalid use of template
+ * g++.old-deja/g++.pt/ptrmem1.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.pt/spec10.C: Likewise.
* g++.old-deja/g++.pt/spec28.C: Reorder declarations.
* g++.old-deja/g++.robertl/eb79.C: Correct for new name lookup rules.
* g++.old-deja/g++.robertl/eb82.C: Remove stray semicolons.
* g++.old-deja/g++.robertl/eb86.C: Add missing forward declaration.
-
+
2002-12-26 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/warn/inline1.C: New test.
* g++.dg/template/conv5.C: New test.
2002-12-24 Nathan Sidwell <nathan@codesourcery.com>
-
+
* g++.dg/lookup/scoped3.C: New test.
-
+
* g++.dg/lookup/decl1.C: New test.
* g++.dg/lookup/decl2.C: New test.
2002-12-23 Mark Mitchell <mark@codesourcery.com>
* gcc.dg/i386-bitfield3.c: New test.
-
+
* gcc.dg/i386-bitfield2.c: New test.
-
+
2002-12-22 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/conv_op1.C: New test.
--- /dev/null
+extern int a;
--- /dev/null
+/* Unpatched, this file would include "inc/ foo.h" (note the space) */
+
+#define PREINC_XSTR(str) #str
+#define PREINC_STR(str) PREINC_XSTR(str)
+#define COMP_INC(comp,file) PREINC_STR(comp/file)
+
+#include COMP_INC(inc, foo.h)