Bug 63397 - signed integer overflows in ira.c
Summary: signed integer overflows in ira.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: ubsan
  Show dependency treegraph
 
Reported: 2014-09-28 09:55 UTC by Markus Trippelsdorf
Modified: 2014-12-16 07:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2014-09-28 09:55:05 UTC
gcc build with -fsanitize=undefined shows:

markus@x4 testsuite % gcc -c -Os  gcc.dg/atomic/c11-atomic-exec-3.c
gcc/ira.c:2465:24: runtime error: signed integer overflow: -2095982000 + -65536000 cannot be represented in type 'int'
gcc/ira.c:2472:31: runtime error: signed integer overflow: -2095102000 + -65536000 cannot be represented in type 'int'
Comment 1 Vladimir Makarov 2014-12-15 22:19:24 UTC
Author: vmakarov
Date: Mon Dec 15 22:18:51 2014
New Revision: 218766

URL: https://gcc.gnu.org/viewcvs?rev=218766&root=gcc&view=rev
Log:
2014-12-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/63397
	* ira-int.h (ira_overall_cost, ira_reg_cost, ira_mem_cost): Use
	int64_t.
	(ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto.
	* ira.c (ira_overall_cost, ira_overall_cost_before): Ditto.
	(ira_reg_cost, ira_mem_cost): Ditto.
	(ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto.
	(calculate_allocation_cost, do_reload): Use the right
	format for int64_t values.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-int.h
    trunk/gcc/ira.c
Comment 2 Markus Trippelsdorf 2014-12-16 07:10:02 UTC
Fixed. Thanks.