Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 27120
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Richard Guenther <rguenth@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 27120 depends on: Show dependency tree
Show dependency graph
Bug 27120 blocks: 10138 24639

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2006-04-30 07:47 Opened: 2006-04-11 15:56
int foo(int i)
{
  char buffer[10];
  return buffer[i];
}

does not warn about the use of uninitialized array buffer.  While

int foo(int i)
{
  char buffer[10];
  return buffer[2];
}

does.  Likewise for C++.

------- Comment #1 From Andrew Pinski 2006-04-11 17:30 -------
Related to PR 10138.

------- Comment #2 From Andrew Pinski 2006-04-30 07:47 -------
(In reply to comment #0)
[first testcase using nonconstant index]
> 
> does not warn about the use of uninitialized array buffer.  While
> 
[second testcase using constant index]
> 
> does.  Likewise for C++.

In the second example, SRA works on the array, scalarizes the array which
allows for the current initialization warning to happen.  Now maybe we should
do the uninitialization  warning in the front-end.

------- Comment #3 From Francois-Xavier Coudert 2009-03-28 13:39 -------
*** Bug 35234 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug