[Bug c/15454] miscompilation of __print_fp from stdio

belyshev at lubercy dot com gcc-bugzilla@gcc.gnu.org
Sat May 15 21:34:00 GMT 2004


------- Additional Comments From belyshev at lubercy dot com  2004-05-15 09:01 -------
Created an attachment (id=6299)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6299&action=view)
minimized testcase (276 bytes)

void abort ();
int main () {
	int foo;
	int bar (void)
	{	  
		int baz = 0;
		if (foo)
			baz = foo;
		return baz;
	}

	foo = 1;
	if (!bar ())
		abort ();
	return 0;
}

Before CCP:

;; Function bar (bar.0)

bar ()
{
  int baz;
  int foo.1;

<bb 0>:
  foo.1_4 = CHAIN.3_3->foo;
  if (foo.1_4 != 0) goto <L0>; else goto <L1>;

<L0>:;

  # baz_1 = PHI <0(0), foo.1_4(1)>;
<L1>:;
  return baz_1;

}

After:

;; Function bar (bar.0)

bar ()
{
  int baz;
  int foo.1;

<bb 0>:
  foo.1_4 = CHAIN.3_3->foo;
  if (foo.1_4 != 0) goto <L0>; else goto <L1>;

<L0>:;

  # baz_1 = PHI <0(0), foo.1_4(1)>;
<L1>:;
  return 0;

}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #6298 is|0                           |1
           obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15454



More information about the Gcc-bugs mailing list