Commit 10b6a274 by Zack Weinberg

rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P.

	* rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P.
	* varasm.c (struct varasm_status): Add deferred_constants field.
	(n_deferred_strings): Delete variable.
	(n_deferred_constants): New #define.
	(struct constant_descriptor_tree): Kill next and label fields.
	(const_hash_table, MAX_HASH_TABLE): Delete.
	(const_desc_htab): New static variable.
	(const_hash): Rename const_desc_hash, and make it fit the
	hashtab.h interface.
	(const_desc_eq): New.
	(const_hash_1, compare_constant): Const-ify arguments.
	(build_constant_desc): Set DEFERRED_CONSTANT_P on all new
	SYMBOL_REFs.  Clarify comments.  Don't set desc->label.
	(output_constant_def): Do the lookup/insert using the
	hashtab.h interface.  Don't muck with n_deferred_constants or
	DEFERRED_CONSTANT_P here.
	Always call maybe_output_constant_def_contents.
	(maybe_output_constant_def_contents): Take a pointer to the
	descriptor, not the EXP and RTL separately.  Return
	immediately if this constant is not deferred.  Defer output of
	everything, except writable string constants.  Update
	n_deferred_constants here.
	(output_constant_def_contents): Now takes just one argument,
	an rtx.  Clear DEFERRED_CONSTANT_P here.
	(mark_constant_pool): Update for rename of n_deferred_strings.
	(mark_constant): Don't clear DEFERRED_CONSTANT_P here.

	(init_varasm_status): Clear p->deferred_constants.
	(init_varasm_once): Call htab_create_ggc for const_desc_htab.

	* gcc.dg/const-elim-1.c, gcc.dg/const-elim-2.c: New testcases.

From-SVN: r66505
parent 68ef8841
2003-05-05 Zack Weinberg <zack@codesourcery.com>
* rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P.
* varasm.c (struct varasm_status): Add deferred_constants field.
(n_deferred_strings): Delete variable.
(n_deferred_constants): New #define.
(struct constant_descriptor_tree): Kill next and label fields.
(const_hash_table, MAX_HASH_TABLE): Delete.
(const_desc_htab): New static variable.
(const_hash): Rename const_desc_hash, and make it fit the
hashtab.h interface.
(const_desc_eq): New.
(const_hash_1, compare_constant): Const-ify arguments.
(build_constant_desc): Set DEFERRED_CONSTANT_P on all new
SYMBOL_REFs. Clarify comments. Don't set desc->label.
(output_constant_def): Do the lookup/insert using the
hashtab.h interface. Don't muck with n_deferred_constants or
DEFERRED_CONSTANT_P here.
Always call maybe_output_constant_def_contents.
(maybe_output_constant_def_contents): Take a pointer to the
descriptor, not the EXP and RTL separately. Return
immediately if this constant is not deferred. Defer output of
everything, except writable string constants. Update
n_deferred_constants here.
(output_constant_def_contents): Now takes just one argument,
an rtx. Clear DEFERRED_CONSTANT_P here.
(mark_constant_pool): Update for rename of n_deferred_strings.
(mark_constant): Don't clear DEFERRED_CONSTANT_P here.
(init_varasm_status): Clear p->deferred_constants.
(init_varasm_once): Call htab_create_ggc for const_desc_htab.
2003-05-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_stpcpy): Only expand when the length
......@@ -5,9 +37,9 @@
2003-05-05 Aldy Hernandez <aldyh@redhat.com>
* testsuite/gcc.c-torture/compile/simd-6.c: New.
* testsuite/gcc.c-torture/compile/simd-6.c: New.
* c-typeck.c (digest_init): Handle arrays of vector constants.
* c-typeck.c (digest_init): Handle arrays of vector constants.
2003-05-05 Jakub Jelinek <jakub@redhat.com>
......@@ -19,17 +51,17 @@
2003-05-05 Aldy Hernandez <aldyh@redhat.com>
* testsuite/gcc.dg/20030505.c: New.
* testsuite/gcc.dg/20030505.c: New.
* c-typeck.c (convert_for_assignment): Opaque pointers can
interconvert.
* c-typeck.c (convert_for_assignment): Opaque pointers can
interconvert.
* config/rs6000/rs6000.c: New global opaque_p_V2SI_type_node.
(rs6000_init_builtins): Initialize opaque_p_V2SI_type_node.
(spe_init_builtins): Rename all pv2si_type_node to
opaque_p_V2SI_type_node.
Remove declaration of pv2si_type_node.
(is_ev64_opaque_type): Accept opaque pointers.
* config/rs6000/rs6000.c: New global opaque_p_V2SI_type_node.
(rs6000_init_builtins): Initialize opaque_p_V2SI_type_node.
(spe_init_builtins): Rename all pv2si_type_node to
opaque_p_V2SI_type_node.
Remove declaration of pv2si_type_node.
(is_ev64_opaque_type): Accept opaque pointers.
2003-05-05 Geoffrey Keating <geoffk@apple.com>
......@@ -40,27 +72,27 @@
(rs6000_generate_compare): Use flag_finite_math_only.
(rs6000_emit_cmove): Handle UNLE. Support UNEQ under -ffast-math.
Use HONOR_* rather than flag_unsafe_math_optimizations. Correct
UNGE and GT cases. Handle UNEQ and LTGT when ! HONOR_NANS.
UNGE and GT cases. Handle UNEQ and LTGT when ! HONOR_NANS.
* toplev.c (check_global_declarations): Suppress not-used warning
for volatile variables.
2003-05-05 Olivier Hainque <hainque@act-europe.fr>
* expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing
usage of bitfield instructions for mode1 != BLKmode, only ignoring
SLOW_UNALIGNED_ACCESS if the field is not byte aligned.
(store_field): Likewise.
* expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing
usage of bitfield instructions for mode1 != BLKmode, only ignoring
SLOW_UNALIGNED_ACCESS if the field is not byte aligned.
(store_field): Likewise.
2003-05-05 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
evsubifw to builtins accepting 5-bit unsigned constants.
(easy_vector_constant): Return if V1DImode. Fix typo.
* config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
evsubifw to builtins accepting 5-bit unsigned constants.
(easy_vector_constant): Return if V1DImode. Fix typo.
2003-05-05 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/spe.h: Revert licensing change from last patch.
* config/rs6000/spe.h: Revert licensing change from last patch.
2003-05-05 DJ Delorie <dj@redhat.com>
......@@ -77,7 +109,7 @@
2003-05-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc
is defined.
is defined.
2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
......
......@@ -1234,10 +1234,11 @@ do { \
#define CONSTANT_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
/* 1 if RTX is a symbol_ref that addresses this function's string constant
pool */
#define STRING_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1("STRING_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->frame_related)
/* 1 if RTX is a symbol_ref that addresses a value in the file's constant
pool which has not yet been output. This information is private to
varasm.c. */
#define DEFERRED_CONSTANT_P(RTX) \
(RTL_FLAG_CHECK1("DEFERRED_CONSTANT_P", (RTX), SYMBOL_REF)->frame_related)
/* Used if RTX is a symbol_ref, for machine-specific purposes. */
#define SYMBOL_REF_FLAG(RTX) \
......
2003-05-05 Zack Weinberg <zack@codesourcery.com>
* gcc.dg/const-elim-1.c, gcc.dg/const-elim-2.c: New testcases.
2003-05-05 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/string-opt-18.c (main): Add 3 new tests.
......
/* Verify that constants in memory, referenced only by dead code,
are not emitted to the object file.
FIXME: Not presently possible to apply -pedantic to code with
complex constants in it. The __extension__ should shut up the
warning but doesn't. (Hard to fix -- the lexer is not aware of
the parser's state.) */
/* { dg-do compile } */
/* { dg-options "-O2 -std=c99" } */
/* { dg-final { scan-assembler-not "LC" } } */
#define I (__extension__ 1.0iF)
struct S { int a; double b[2]; void *c; };
extern void use_str(const char *);
extern void use_S(const struct S *);
extern void use_cplx(__complex__ double);
static inline int
returns_23(void) { return 23; }
void
test1(void)
{
if (returns_23() == 23)
return;
use_str("waltz, nymph, for quick jigs vex bud");
use_S(&(const struct S){12, {3.1415, 2.1828}, 0 });
use_cplx(3.1415 + 2.1828*I);
}
void
test2(void)
{
const char *str = "pack my box with five dozen liquor jugs";
const struct S S = { 23, { 1.414, 1.618 }, 0 };
const __complex__ double cplx = 1.414 + 1.618*I;
if (returns_23() == 23)
return;
use_str(str);
use_S(&S);
use_cplx(cplx);
}
/* The string constant in this test case should be emitted exactly once. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "hi there" 1 } } */
static inline int returns_23() { return 23; }
const char *test1(void) { if (returns_23()) return 0; return "hi there"; }
const char *test2(void) { return "hi there"; }
const char *test3(void) { return "hi there"; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment