Bug 37418 - [4.4 Regression] error: type mismatch in address expression, verify_gimple failed
Summary: [4.4 Regression] error: type mismatch in address expression, verify_gimple fa...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P1 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
: 37467 37510 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-08 08:47 UTC by Martin Michlmayr
Modified: 2008-10-16 08:20 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-13 18:59:07


Attachments
Preprocessed code (11.79 KB, application/octet-stream)
2008-09-08 08:53 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2008-09-08 08:47:38 UTC
With current trunk (revision 140100):


(sid)1092:tbm@em64t: ~] /usr/lib/gcc-snapshot/bin/gcc -c dovecot-failures.i
failures.c: In function 'i_set_panic_handler':
failures.c:242: error: type mismatch in address expression
void (*<T678>) (const char *, struct  *)

void (*<Tab6>) (const char *, struct  *)

callback = default_panic_handler;

failures.c:242: internal compiler error: verify_gimple failed
Please submit a full bug report,
Comment 1 Martin Michlmayr 2008-09-08 08:53:54 UTC
Created attachment 16252 [details]
Preprocessed code
Comment 2 Andrew Pinski 2008-09-08 20:38:03 UTC
Reducing ...
Comment 3 Andrew Pinski 2008-09-08 20:44:49 UTC
Reduced testcase:
typedef void failure_callback_t(int);
void default_panic_handler(int args)__attribute__((noreturn));
void i_set_panic_handler(failure_callback_t *callback __attribute__((noreturn)))
{
  callback = default_panic_handler;
}

Comment 4 Jakub Jelinek 2008-09-10 06:45:13 UTC
This is IMHO a C FE bug (works with C++ just fine and the MODIFY_EXPR with non-useless type conversion between LHS and RHS type is created by the C FE).
Comment 5 Andrew Pinski 2008-09-10 19:43:13 UTC
*** Bug 37467 has been marked as a duplicate of this bug. ***
Comment 6 Joseph S. Myers 2008-09-13 18:59:07 UTC
Working on a patch.  It's not a MODIFY_EXPR but an ADDR_EXPR with problematic
conversion.
Comment 7 Richard Biener 2008-09-13 19:59:16 UTC
*** Bug 37510 has been marked as a duplicate of this bug. ***
Comment 8 Richard Biener 2008-10-08 15:59:45 UTC
Looks like I taked over ...
Comment 9 Richard Biener 2008-10-16 08:20:08 UTC
Fixed.
Comment 10 Richard Biener 2008-10-16 08:21:12 UTC
Subject: Bug 37418

Author: rguenth
Date: Thu Oct 16 08:19:49 2008
New Revision: 141165

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141165
Log:
2008-10-16  Joseph Myers  <joseph@codesourcery.com>
        Richard Guenther  <rguenther@suse.de>

	PR middle-end/37418
	* tree-ssa.c (useless_type_conversion_p_1): Do not treat
	volatile qualified functions or methods as relevant.

	* gcc.c-torture/compile/pr37418-1.c,
	gcc.c-torture/compile/pr37418-2.c,
	gcc.c-torture/compile/pr37418-3.c,
	gcc.c-torture/compile/pr37418-4.c: New tests.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37418-1.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37418-2.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37418-3.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37418-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa.c