public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/33592] FAIL: gfortran.dg/array_constructor_11.f90 -O1 execution test Date: Fri, 09 Nov 2007 16:07:00 -0000 [thread overview] Message-ID: <20071109160718.30512.qmail@sourceware.org> (raw) In-Reply-To: <bug-33592-276@http.gcc.gnu.org/bugzilla/> ------- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-11-09 16:07 ------- My mistake. This comes from a typo in trans.c (a EQ_EXPR instead of an NE_EXPR). Could you test this patch? Index: trans.c =================================================================== --- trans.c (revision 129869) +++ trans.c (working copy) @@ -829,19 +829,19 @@ internal_realloc (void *mem, size_t size { if (size < 0) runtime_error ("Attempt to allocate a negative amount of memory."); - mem = realloc (mem, size); - if (!mem && size != 0) + res = realloc (mem, size); + if (!res && size != 0) _gfortran_os_error ("Out of memory"); if (size == 0) return NULL; - return mem; + return res; } */ tree gfc_call_realloc (stmtblock_t * block, tree mem, tree size) { - tree msg, res, negative, zero, null_result, tmp; + tree msg, res, negative, nonzero, zero, null_result, tmp; tree type = TREE_TYPE (mem); size = gfc_evaluate_now (size, block); @@ -868,10 +868,10 @@ gfc_call_realloc (stmtblock_t * block, t gfc_add_modify_expr (block, res, fold_convert (type, tmp)); null_result = fold_build2 (EQ_EXPR, boolean_type_node, res, build_int_cst (pvoid_type_node, 0)); - zero = fold_build2 (EQ_EXPR, boolean_type_node, size, - build_int_cst (size_type_node, 0)); + nonzero = fold_build2 (NE_EXPR, boolean_type_node, size, + build_int_cst (size_type_node, 0)); null_result = fold_build2 (TRUTH_AND_EXPR, boolean_type_node, null_result, - zero); + nonzero); msg = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const ("Out of memory")); tmp = fold_build3 (COND_EXPR, void_type_node, null_result, @@ -881,6 +881,7 @@ gfc_call_realloc (stmtblock_t * block, t /* if (size == 0) then the result is NULL. */ tmp = fold_build2 (MODIFY_EXPR, type, res, build_int_cst (type, 0)); + zero = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, nonzero); tmp = fold_build3 (COND_EXPR, void_type_node, zero, tmp, build_empty_stmt ()); gfc_add_expr_to_block (block, tmp); -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Component|target |fortran Ever Confirmed|0 |1 Keywords| |wrong-code Known to fail| |4.3.0 Last reconfirmed|0000-00-00 00:00:00 |2007-11-09 16:07:17 date| | Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33592
next prev parent reply other threads:[~2007-11-09 16:07 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-09-29 18:48 [Bug target/33592] New: " danglin at gcc dot gnu dot org 2007-09-29 19:00 ` [Bug target/33592] " rguenth at gcc dot gnu dot org 2007-09-29 20:18 ` danglin at gcc dot gnu dot org 2007-11-09 16:07 ` fxcoudert at gcc dot gnu dot org [this message] 2007-11-09 16:45 ` [Bug fortran/33592] " dave at hiauly1 dot hia dot nrc dot ca 2007-11-10 17:49 ` dave at hiauly1 dot hia dot nrc dot ca 2007-11-10 18:02 ` fxcoudert at gcc dot gnu dot org 2007-11-10 18:04 ` fxcoudert at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071109160718.30512.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).