Bug 24222

Summary: [meta-bug] The gimplifier shouldn't emit warnings or errors
Product: gcc Reporter: Chris Lattner <sabre>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: normal CC: egallager, gcc-bugs, gdr, pinskia
Priority: P2 Keywords: diagnostic, meta-bug
Version: unknown   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-03-18 16:26:58
Bug Depends on: 26749, 26747, 26748, 26750, 26751    
Bug Blocks:    

Description Chris Lattner 2005-10-06 01:29:06 UTC
Compiling a C++ file with -fsyntax-only -ftime-report includes time spent on 'tree gimplify'.  Unless I'm missing something, -fsyntax-only shouldn't have to gimplify anything.

-Chris
Comment 1 Andrew Pinski 2005-10-06 01:30:31 UTC
This needed for some syntaxical analysis, IIRC.
Comment 2 Andrew Pinski 2005-10-06 01:37:42 UTC
The following explains about the C compiler:
http://gcc.gnu.org/ml/gcc/2004-05/msg00257.html

It is semantical analysis and not syntax.
Comment 3 Andrew Pinski 2005-10-06 01:42:18 UTC
right now if we don't gimplify with -fsyntax-only, we would not be able to diagnostic the following:
void f(void)
{
  break;
}
Comment 4 Chris Lattner 2005-10-06 01:51:57 UTC
The gimplifier apparently emits these three errors:

error ("memory input %d is not directly addressable", i);
error ("invalid lvalue in asm output %d", i);
error ("too few arguments to function %<va_start%>");

In an ideal, modular, world, the front-ends should be emitting these.  If these checks need to be shared across different front-ends, the checks could be function calls in c-common, not be put into the gimplifier.

One immediate advantage would be that -fsyntax-only wouldn't need to run the gimplifier.

-Chris
Comment 5 Gabriel Dos Reis 2005-10-06 20:56:35 UTC
Subject: Re:  -fsyntax-only runs the gimplifier

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| right now if we don't gimplify with -fsyntax-only, we would not be able to
| diagnostic the following:
| void f(void)
| {
|   break;
| }

That is one more reason why it is a bug in the compiler.

-- Gaby
Comment 6 Gabriel Dos Reis 2005-10-06 20:57:13 UTC
Subject: Re:   New: -fsyntax-only runs the gimplifier

"sabre at nondot dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Compiling a C++ file with -fsyntax-only -ftime-report includes time spent on
| 'tree gimplify'.  Unless I'm missing something, -fsyntax-only
| shouldn't have to gimplify anything.

I strongly agree that that is a bug in the way the compiler currently works.

-- Gaby
Comment 7 Gabriel Dos Reis 2005-12-04 05:17:09 UTC
(In reply to comment #3)
> right now if we don't gimplify with -fsyntax-only, we would not be able to
> diagnostic the following:
> void f(void)
> {
>   break;
> }

If that is true, then it should be considered a bug in the C++ front-end. 

Comment 8 Andrew Pinski 2006-03-18 16:26:58 UTC
I am going to seperate this into a couple of different bugs.
Comment 9 Andrew Pinski 2006-03-18 16:39:27 UTC
I found some other ones which had been added after this bug report was open :(.
Comment 10 Eric Gallager 2018-12-21 04:50:03 UTC
(In reply to Andrew Pinski from comment #9)
> I found some other ones which had been added after this bug report was open
> :(.

Well at least there's only 1 of them left open