This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH [mainline] - Fix a bug with IMI in crafty
- From: Fariborz Jahanian <fjahanian at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Fariborz Jahanian <fjahanian at apple dot com>
- Date: Tue, 9 Mar 2004 12:22:00 -0800
- Subject: PATCH [mainline] - Fix a bug with IMI in crafty
This patch fixes a bug in crafty (SPEC program) when compiling with
Intermodule Analysis and
inlining. Attempt to convert an expression to a new type fails because
the new type is coming
from a different translation unit.
/* header.h */
struct S {
int i1;
int i2;
};
/*foo.c*/
#include "header.h"
int foo(struct S val)
{
val.i1 = 1;
val.i2 = 2;
return val.i1 + val.i2;
}
/* main.c */
#include "header.h"
struct S search;
extern int foo(struct S);
int main()
{
return foo(search);
}
>> gcc -c main.c foo.c -O3
main.c: In function `main':
main.c:9: error: conversion to non-scalar type requested
OK for mainline?
- fariborz jahanian (fjahanian@apple.com)
ChangeLog:
2004-03-09 Fariborz Jahanian <fjahanian@apple.com>
* c-convert.c (convert): Make convert work when converting to
compatible types across translation unit.
* tree.h: same_translation_unit_p, tagged_types_tu_compatible_p
decalared extern.
* c-typeck.c: same_translation_unit_p,
tagged_types_tu_compatible_p
declared global.
Attachment:
ima-crafty-patch.txt
Description: Text document