Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 16876
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: marcus@jet.franken.de
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
parse_opts.i parse_opts.i text/plain 2004-08-04 15:34 100 bytes Edit
tmp patch patch 2006-08-24 19:13 689 bytes Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 16876 depends on: Show dependency tree
Show dependency graph
Bug 16876 blocks: 29478

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-11-20 20:28 Opened: 2004-08-04 15:34
On AMD64, PPC, PPC64, i386: 
 
gcc -O3 -c parse_opts.i 
parse_opts.i: In function `f': 
parse_opts.i:11: internal compiler error: in gen_lowpart, at emit-rtl.c:1436 
 
The code is invalid (a bit), but it should not crash. 
 
reproduced with mainline from some days ago, 3.3-hammer branch, 3.4 branch 
too.

------- Comment #1 From marcus@jet.franken.de 2004-08-04 15:34 -------
Created an attachment (id=6881) [edit]
parse_opts.i

compile with -O3 or -finline-functions

------- Comment #2 From Andrew Pinski 2004-08-04 15:41 -------
Confirmed, the code is undefined.  With the mainline we get a different ICE:
pr16876.c: In function `f':
pr16876.c:8: internal compiler error: in fold_convert, at fold-const.c:2000
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

But this is because of changes by me and other people.

Really this is a regression from 2.95.3 and 3.0.4 but that is because of the use of the RTL inliner with 
those versions instead of the tree inline.

------- Comment #3 From Andrew Pinski 2004-11-02 15:52 -------
: Search converges between 2001-11-11-trunk (#45) and 2001-11-18-trunk (#46).

------- Comment #4 From Uros Bizjak 2005-02-22 10:49 -------
The problem in mainline is that 'tree type' of RECORD_TYPE enters
fold_convert()
and triggers gcc_unreachable() in line 2003.

However Borland C++ exits with error: "Call to function 'g' with no prototype."
on line where g(0) is called.

------- Comment #5 From Andrew Pinski 2005-02-22 13:45 -------
*** Bug 20141 has been marked as a duplicate of this bug. ***

------- Comment #6 From Andrew Pinski 2005-03-29 14:04 -------
*** Bug 20680 has been marked as a duplicate of this bug. ***

------- Comment #7 From Joseph S. Myers 2005-03-29 14:58 -------
See also my notes <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00772.html> on
what should receive warnings (possibly compiled into aborts), what should
receive errors and how c_convert_parm_for_inlining (a) is too late for such
diagnostics and (b) fails actually to carry out the conversion or diagnostics
in certain cases.

------- Comment #8 From Andrew Pinski 2005-10-05 11:59 -------
*** Bug 24210 has been marked as a duplicate of this bug. ***

------- Comment #9 From Mark Mitchell 2005-10-30 22:44 -------
P2 is the right setting for this bug; it's popping up often enough to make it
worth fixing.  Disabling the inlining in the case that the argument type
doesn't match (closely enough) the parameter type seems reasonable to me, even
without introducing a subsequent runtime abort.  That would be equivalent to
the behavior if the function called appeared in a different translation unit.

------- Comment #10 From Steven Bosscher 2005-12-18 17:15 -------
rth assigned this to himself:
http://gcc.gnu.org/ml/gcc-bugs/2005-11/msg02843.html

A progress report would be nice ;-)

------- Comment #11 From Mark Mitchell 2006-02-24 00:25 -------
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.

------- Comment #12 From Mark Mitchell 2006-05-25 02:31 -------
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.

------- Comment #13 From Steven Bosscher 2006-06-05 10:41 -------
Unassigning rth, since he's obviously not actually interested in fixing this.

------- Comment #14 From Steven Bosscher 2006-06-05 10:44 -------
The failures in 3.4 and later are in fold_const, so the gen_lowpart problem is
now avoided by, well, ICEing earlier :)

------- Comment #15 From Jorn Wolfgang Rennecke 2006-08-24 19:13 -------
Created an attachment (id=12130) [edit]
patch

I think this should do the trick.

------- Comment #16 From Jorn Wolfgang Rennecke 2006-08-25 18:52 -------
Subject: Bug 16876

Author: amylaar
Date: Fri Aug 25 18:51:57 2006
New Revision: 116424

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116424
Log:
gcc:
        PR tree-optimization/16876
        * c-typeck.c (c_convert_parm_for_inlining): Don't take early
        exit if PARM doesn't match VALUE.

testsuite:
        gcc.dg/noncompile/pr16876.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/noncompile/pr16876.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog

------- Comment #17 From Richard Guenther 2006-10-18 09:26 -------
A backport of the patch bootstraps & regtests ok on the 4.1 branch, but I'm
unsure we want the side-effects of the rejects-valid, because this is valid
code according to jsm (only undefined at runtime).

------- Comment #18 From Andrew Pinski 2006-10-18 18:56 -------
(In reply to comment #17)
> A backport of the patch bootstraps & regtests ok on the 4.1 branch.
Except it introduces PR 29478.

------- Comment #19 From Richard Guenther 2007-06-23 18:18 -------
Subject: Bug 16876

Author: rguenth
Date: Sat Jun 23 18:17:57 2007
New Revision: 125974

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125974
Log:
2007-06-23  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/16876
        PR middle-end/29478
        * tree.h (CALL_CANNOT_INLINE_P): New macro to access static_flag
        for CALL_EXPRs.
        * tree-inline.c (initialize_inlined_parameters): Do not call
        lang_hooks.tree_inlining.convert_parm_for_inlining.
        * cgraphbuild.c (initialize_inline_failed): Set inline failed
        reason for mismatched types.
        * gimplify.c (gimplify_call_expr): Verify the call expression
        arguments match the called function type signature.  Otherwise
        mark the call expression to be not considered for inlining
        using CALL_CANNOT_INLINE_P flag.
        * ipa-inline.c (cgraph_mark_inline): Honor CALL_CANNOT_INLINE_P on the
        edges call expression.
        (cgraph_decide_inlining_of_small_function): Likewise.
        (cgraph_decide_inlining): Likewise.
        * c-objc-common.h (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
        Remove define.
        * c-tree.h (c_convert_parm_for_inlining): Remove declaration.
        * c-typeck.c (c_convert_parm_for_inlining): Remove.
        * langhooks-def.h (lhd_tree_inlining_convert_parm_for_inlining):
        Remove declaration.
        (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): Remove define.
        * langhooks.c (lhd_tree_inlining_convert_parm_for_inlining):
        Remove.
        * langhooks.h (struct lang_hooks_for_tree_inlining): Remove
        convert_parm_for_inlining member.

        * gcc.dg/pr29254.c: The warning is bogus.
        * gcc.dg/warn-1.c: Likewise.
        * gcc.dg/assign-warn-3.c: Likewise.
        * gcc.dg/noncompile/pr16876.c: The testcase is bogus, remove.

Removed:
    trunk/gcc/testsuite/gcc.dg/noncompile/pr16876.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-objc-common.h
    trunk/gcc/c-tree.h
    trunk/gcc/c-typeck.c
    trunk/gcc/cgraphbuild.c
    trunk/gcc/gimplify.c
    trunk/gcc/ipa-inline.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.c
    trunk/gcc/langhooks.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/assign-warn-3.c
    trunk/gcc/testsuite/gcc.dg/pr29254.c
    trunk/gcc/testsuite/gcc.dg/warn-1.c
    trunk/gcc/tree-inline.c
    trunk/gcc/tree.h

------- Comment #20 From Volker Reichelt 2007-07-03 00:10 -------
As the code is deemed valid, we still have a rejects-valid bug on the 4.2
branch.

------- Comment #21 From Mark Mitchell 2007-10-09 19:20 -------
Change target milestone to 4.2.3, as 4.2.2 has been released.

------- Comment #22 From Joseph S. Myers 2008-02-01 16:52 -------
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.

------- Comment #23 From Joseph S. Myers 2008-05-19 20:22 -------
4.2.4 is being released, changing milestones to 4.2.5.

------- Comment #24 From Joseph S. Myers 2008-07-04 22:44 -------
Closing 4.1 branch.

------- Comment #25 From Joseph S. Myers 2009-03-30 15:37 -------
Closing 4.2 branch.  Original bug was fixed for 4.2.0, rejects-valid
for 4.3.0.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug