From 5f55f73646a8a4fe1bbba4f30081b323c3185379 Mon Sep 17 00:00:00 2001 From: steven Date: Mon, 19 Sep 2005 05:04:58 +0000 Subject: [PATCH] gcc/ PR rtl-optimization/23943 * cse.c (find_best_addr): Never propagate an EXPR_LIST rtx. testsuite/ * gcc.dg/pr23943.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104413 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/cse.c | 4 +++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr23943.c | 20 ++++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr23943.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9da5292..3e7d70a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-09-19 Steven Bosscher + + PR rtl-optimization/23943 + * cse.c (find_best_addr): Never propagate an EXPR_LIST rtx. + 2005-09-18 Jan Hubicka * calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK. diff --git a/gcc/cse.c b/gcc/cse.c index 713b842..defa561 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -2999,7 +2999,9 @@ find_best_addr (rtx insn, rtx *loc, enum machine_mode mode) p = p->next_same_value, count++) if (! p->flag && (REG_P (p->exp) - || exp_equiv_p (p->exp, p->exp, 1, false))) + || (GET_CODE (p->exp) != EXPR_LIST + && exp_equiv_p (p->exp, p->exp, 1, false)))) + { rtx new = simplify_gen_binary (GET_CODE (*loc), Pmode, p->exp, op1); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee977a6..367ffae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-09-19 Steven Bosscher + + * gcc.dg/pr23943.c: New test. + 2005-09-18 Paul Thomas PR fortran/19181 diff --git a/gcc/testsuite/gcc.dg/pr23943.c b/gcc/testsuite/gcc.dg/pr23943.c new file mode 100644 index 0000000..f0e60bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr23943.c @@ -0,0 +1,20 @@ +/* This used to ICE in side_effects_p, due to a problem in cse.c. + Origin: marcus at jet dot franken dot de. */ +/* { dg-do compile { target x86_64-*-* } } */ +/* { dg-options "-O2 -fPIC" } */ + +typedef long unsigned int size_t; + +extern size_t strlen (__const char *__s) + __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + +static char savecallsin[256] = ""; + +int read_agent_config(void) +{ + savecallsin[0] = '\0'; + + if (savecallsin[strlen(savecallsin) - 1] != '/') + __builtin___strncat_chk (savecallsin, "/", sizeof(savecallsin) - strlen(savecallsin) - 1, __builtin_object_size (savecallsin, 2 > 1)) ; + return 0; +} -- 2.7.4