[LLVMbugs] [Bug 5205] New: extractvalue requires constants even for local arrays.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Oct 15 16:03:05 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=5205

           Summary: extractvalue requires constants even for local arrays.
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: vanreece at gmail.com
                CC: nicholas at mxc.ca, llvmbugs at cs.uiuc.edu,
                    vanreece at gmail.com


If arrays (or arrays within structures) are considered first class, you should
be able to get at them in a general fashion.

Right now, you must use extractvalue with constant parameters, whereas it
should match getelementpointer in that if you're dealing with an array, you can
use variables.

If you have the equivalent of this code:

struct A { int x; ints[100] y; };
...
struct A mystruct;
int arbitrary = ...
mystruct.y[arbitrary] = mystruct.y[arbitrary] + 1

There's no clean way to do this in llvm. You either need to store the struct to
memory and then use gep on it, or you can use extractvalue and insertvalue but
only with constant indices.

Not so first classish.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list