public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized
@ 2003-10-27 19:05 chris at pin dot lu
2003-10-27 20:18 ` [Bug optimization/12792] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: chris at pin dot lu @ 2003-10-27 19:05 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
Summary: {u,}int64_t variables are incorrectly reported as used
uninitialized
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chris at pin dot lu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-unknown-netbsdelf
GCC host triplet: m68k--netbsdelf
GCC target triplet: m68k--netbsdelf
long long int and long long unsigned int variables trigger the following
warning even though the variables are initialized:
longlongint.c: In function `main':
longlongint.c:7: warning: `blkno' might be used uninitialized in this function
reduced test case:
---- cut here ----
# 1 "longlongint.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "longlongint.c"
int printf (const char * __restrict, ...);
int
main(int argc, char **argv)
{
long long int blkno;
long long int t5;
t5 = 1;
blkno = t5 * t5;
printf("%lld\n", blkno);
return 0;
}
---- cut here ----
compilation command:
> cc -O1 -Wall longlongint.c -c
longlongint.c: In function `main':
longlongint.c:7: warning: `blkno' might be used uninitialized in this function
There's no warning at -O0, there's a warning at Os, O1 and above.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
@ 2003-10-27 20:18 ` pinskia at gcc dot gnu dot org
2003-10-28 21:13 ` mycroft at netbsd dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-27 20:18 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
2003-10-27 20:18 ` [Bug optimization/12792] " pinskia at gcc dot gnu dot org
@ 2003-10-28 21:13 ` mycroft at netbsd dot org
2003-10-30 5:08 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mycroft at netbsd dot org @ 2003-10-28 21:13 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
------- Additional Comments From mycroft at netbsd dot org 2003-10-28 20:52 -------
Created an attachment (id=5014)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5014&action=view)
proposed fix
The problem is thus:
* The {u,}mulsidi3 generate two parallel sets which modify the upper and lower
halves of the target register.
* life_analysis() does not track subregister modifications -- if you don't
modify the whole register with a single set, it considers the register
unused.
The simple, if klugy, solution to this is to stick an explicit clobber in. It
seems to work.
While doing this, I noticed that constant folding was not happening for
32x32->64 multiplies. This is because the parallel set generated by
{u,}mulsidi3 cannot be folded at all. To solve this, I first expand to a
normal multiply, and then use a define_insn_and_split to convert it to the
parallel set after CSE and constant folding.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
2003-10-27 20:18 ` [Bug optimization/12792] " pinskia at gcc dot gnu dot org
2003-10-28 21:13 ` mycroft at netbsd dot org
@ 2003-10-30 5:08 ` pinskia at gcc dot gnu dot org
2003-11-20 8:01 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-30 5:08 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-10-30 05:04:33
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-30 05:04 -------
The proper fix is to teach life_analysis about the two halves.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
` (2 preceding siblings ...)
2003-10-30 5:08 ` pinskia at gcc dot gnu dot org
@ 2003-11-20 8:01 ` pinskia at gcc dot gnu dot org
2004-02-09 2:27 ` pinskia at gcc dot gnu dot org
2004-05-13 20:19 ` [Bug tree-optimization/12792] " pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-20 8:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-20 08:01 -------
*** Bug 13136 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |sami dot kantoluoto at
| |embedtronics dot fi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
` (3 preceding siblings ...)
2003-11-20 8:01 ` pinskia at gcc dot gnu dot org
@ 2004-02-09 2:27 ` pinskia at gcc dot gnu dot org
2004-05-13 20:19 ` [Bug tree-optimization/12792] " pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-09 2:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-09 02:27 -------
Suspending as this is fixed on the tree-ssa by looking at the tree level instead of the rtl
where all problems like this can occur.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Status|NEW |SUSPENDED
Target Milestone|--- |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/12792] {u,}int64_t variables are incorrectly reported as used uninitialized
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
` (4 preceding siblings ...)
2004-02-09 2:27 ` pinskia at gcc dot gnu dot org
@ 2004-05-13 20:19 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-13 20:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-13 11:34 -------
Fixed for 3.5.0 by the merge of the tree-ssa.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|SUSPENDED |RESOLVED
Component|rtl-optimization |tree-optimization
Resolution| |FIXED
Target Milestone|tree-ssa |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12792
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-05-13 11:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-27 19:05 [Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized chris at pin dot lu
2003-10-27 20:18 ` [Bug optimization/12792] " pinskia at gcc dot gnu dot org
2003-10-28 21:13 ` mycroft at netbsd dot org
2003-10-30 5:08 ` pinskia at gcc dot gnu dot org
2003-11-20 8:01 ` pinskia at gcc dot gnu dot org
2004-02-09 2:27 ` pinskia at gcc dot gnu dot org
2004-05-13 20:19 ` [Bug tree-optimization/12792] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).