Bug Summary

File:jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc/adfiles/ad_x86_peephole.cpp
Warning:line 118, column 12
Value stored to 'inst0_idx2' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ad_x86_peephole.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -mthread-model posix -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib/llvm-10/lib/clang/10.0.0 -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/objs/precompiled -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -D _GNU_SOURCE -D _REENTRANT -D LIBC=gnu -D LINUX -D VM_LITTLE_ENDIAN -D _LP64=1 -D ASSERT -D CHECK_UNHANDLED_OOPS -D TARGET_ARCH_x86 -D INCLUDE_SUFFIX_OS=_linux -D INCLUDE_SUFFIX_CPU=_x86 -D INCLUDE_SUFFIX_COMPILER=_gcc -D TARGET_COMPILER_gcc -D AMD64 -D HOTSPOT_LIB_ARCH="amd64" -D COMPILER1 -D COMPILER2 -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc/adfiles -I /home/daniel/Projects/java/jdk/src/hotspot/share -I /home/daniel/Projects/java/jdk/src/hotspot/os/linux -I /home/daniel/Projects/java/jdk/src/hotspot/os/posix -I /home/daniel/Projects/java/jdk/src/hotspot/cpu/x86 -I /home/daniel/Projects/java/jdk/src/hotspot/os_cpu/linux_x86 -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc -I /home/daniel/Projects/java/jdk/src/hotspot/share/precompiled -I /home/daniel/Projects/java/jdk/src/hotspot/share/include -I /home/daniel/Projects/java/jdk/src/hotspot/os/posix/include -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/support/modules_include/java.base -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/support/modules_include/java.base/linux -I /home/daniel/Projects/java/jdk/src/java.base/share/native/libjimage -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc/adfiles -I /home/daniel/Projects/java/jdk/src/hotspot/share -I /home/daniel/Projects/java/jdk/src/hotspot/os/linux -I /home/daniel/Projects/java/jdk/src/hotspot/os/posix -I /home/daniel/Projects/java/jdk/src/hotspot/cpu/x86 -I /home/daniel/Projects/java/jdk/src/hotspot/os_cpu/linux_x86 -I /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc -D _FORTIFY_SOURCE=2 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-10/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-format-zero-length -Wno-unused-parameter -Wno-unused -Wno-parentheses -Wno-comment -Wno-unknown-pragmas -Wno-address -Wno-delete-non-virtual-dtor -Wno-char-subscripts -Wno-array-bounds -Wno-int-in-bool-context -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-empty-body -Wno-strict-overflow -Wno-sequence-point -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-cast-function-type -Wno-shift-negative-value -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /home/daniel/Projects/java/jdk/make/hotspot -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -stack-protector 1 -fno-rtti -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -o /home/daniel/Projects/java/scan/2021-12-21-193737-8510-1 -x c++ /home/daniel/Projects/java/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/gensrc/adfiles/ad_x86_peephole.cpp
1#line 1 "ad_x86_peephole.cpp"
2//
3// Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
4// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5//
6// This code is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License version 2 only, as
8// published by the Free Software Foundation.
9//
10// This code is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13// version 2 for more details (a copy is included in the LICENSE file that
14// accompanied this code).
15//
16// You should have received a copy of the GNU General Public License version
17// 2 along with this work; if not, write to the Free Software Foundation,
18// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19//
20// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21// or visit www.oracle.com if you need additional information or have any
22// questions.
23//
24//
25
26// Machine Generated File. Do Not Edit!
27
28#include "precompiled.hpp"
29#include "adfiles/ad_x86.hpp"
30MachNode *loadINode::peephole(Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted) {
31 bool matches = true;
32 MachNode *inst0 = this;
33 MachNode *inst1 = NULL__null;
34 if( (OptoPeepholeAt == -1) || (OptoPeepholeAt==0) ) {
35 matches = true;
36 // Check instruction sub-tree
37 // Identify previous instruction if inside this block
38 if( block_index - 1 > 0 ) {
39 Node *n = block->get_node(block_index - 1);
40 inst1 = (n->is_Mach()) ? n->as_Mach() : NULL__null;
41 }
42 matches = matches && (inst1 != NULL__null) && (inst1->rule() == storeI_rule);
43 // If instruction subtree matches
44 if( matches ) {
45
46 // Check constraints on sub-tree-leaves
47 // Build map to register info
48 // Start at oper_input_base() and count operands
49 unsigned inst0_idx0 = 2;
50 unsigned inst0_idx1 = 2; // mem
51 unsigned inst0_idx2 = inst0->req();
52 // Start at oper_input_base() and count operands
53 unsigned inst1_idx0 = 2;
54 unsigned inst1_idx1 = 2; // mem
55 unsigned inst1_idx2 = inst1_idx1 + inst1->_opnds[1]->num_edges(); // src
56 unsigned inst1_idx3 = inst1->req();
57 matches = matches &&
58 (inst1->_opnds[2]->reg(ra_,inst1,inst1_idx2) /* 1.src */ == /* 0.dst */ inst0->_opnds[0]->reg(ra_,inst0))
59 && (
60 (inst1->_opnds[1]->base(ra_,inst1,inst1_idx1) /* 1.mem$$base */ == /* 0.mem$$base */ inst0->_opnds[1]->base(ra_,inst0,inst0_idx1)) &&
61 (inst1->_opnds[1]->index(ra_,inst1,inst1_idx1) /* 1.mem$$index */ == /* 0.mem$$index */ inst0->_opnds[1]->index(ra_,inst0,inst0_idx1)) &&
62 (inst1->_opnds[1]->scale() /* 1.mem$$scale */ == /* 0.mem$$scale */ inst0->_opnds[1]->scale()) &&
63 (inst1->_opnds[1]->disp(ra_,inst1,inst1_idx1) /* 1.mem$$disp */ == /* 0.mem$$disp */ inst0->_opnds[1]->disp(ra_,inst0,inst0_idx1))
64)
65;
66 // IF instructions and constraints matched
67 if( matches ) {
68 // generate the new sub-tree
69 assert( true, "Debug stopping point")do { if (!(true)) { (*g_assert_poison) = 'X';; report_vm_error
("ad_x86_peephole.cpp", 68, "assert(" "true" ") failed", "Debug stopping point"
); ::breakpoint(); } } while (0)
;
70 storeINode *root = new storeINode();
71 // ----- Initial setup -----
72 root->add_req(_in[0]); // control edge
73 root->add_req(inst1->in(1)); // unmatched ideal edge
74 root->_bottom_type = inst1->bottom_type();
75 ra_->add_reference(root, inst1);
76 ra_->set_oop (root, ra_->is_oop(inst1));
77 ra_->set_pair(root->_idx, ra_->get_reg_second(inst1), ra_->get_reg_first(inst1));
78 root->_opnds[0] = inst1->_opnds[0]->clone(); // result
79 // ----- Done with initial setup -----
80 for( unsigned x1 = inst1_idx1; x1 < inst1_idx2; x1++ )
81 root->add_req( inst1->in(x1) );
82 root->_opnds[1] = inst1->_opnds[1]->clone();
83 for( unsigned x2 = inst1_idx2; x2 < inst1_idx3; x2++ )
84 root->add_req( inst1->in(x2) );
85 root->_opnds[2] = inst1->_opnds[2]->clone();
86 inst0->set_removed();
87 inst1->set_removed();
88 deleted = 2;
89 return root; // return new root;
90 }
91 }
92 } // end of peephole rule #0
93
94 return NULL__null; // No peephole rules matched
95}
96
97MachNode *loadLNode::peephole(Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted) {
98 bool matches = true;
99 MachNode *inst0 = this;
100 MachNode *inst1 = NULL__null;
101 if( (OptoPeepholeAt == -1) || (OptoPeepholeAt==1) ) {
102 matches = true;
103 // Check instruction sub-tree
104 // Identify previous instruction if inside this block
105 if( block_index - 1 > 0 ) {
106 Node *n = block->get_node(block_index - 1);
107 inst1 = (n->is_Mach()) ? n->as_Mach() : NULL__null;
108 }
109 matches = matches && (inst1 != NULL__null) && (inst1->rule() == storeL_rule);
110 // If instruction subtree matches
111 if( matches ) {
112
113 // Check constraints on sub-tree-leaves
114 // Build map to register info
115 // Start at oper_input_base() and count operands
116 unsigned inst0_idx0 = 2;
117 unsigned inst0_idx1 = 2; // mem
118 unsigned inst0_idx2 = inst0->req();
Value stored to 'inst0_idx2' during its initialization is never read
119 // Start at oper_input_base() and count operands
120 unsigned inst1_idx0 = 2;
121 unsigned inst1_idx1 = 2; // mem
122 unsigned inst1_idx2 = inst1_idx1 + inst1->_opnds[1]->num_edges(); // src
123 unsigned inst1_idx3 = inst1->req();
124 matches = matches &&
125 (inst1->_opnds[2]->reg(ra_,inst1,inst1_idx2) /* 1.src */ == /* 0.dst */ inst0->_opnds[0]->reg(ra_,inst0))
126 && (
127 (inst1->_opnds[1]->base(ra_,inst1,inst1_idx1) /* 1.mem$$base */ == /* 0.mem$$base */ inst0->_opnds[1]->base(ra_,inst0,inst0_idx1)) &&
128 (inst1->_opnds[1]->index(ra_,inst1,inst1_idx1) /* 1.mem$$index */ == /* 0.mem$$index */ inst0->_opnds[1]->index(ra_,inst0,inst0_idx1)) &&
129 (inst1->_opnds[1]->scale() /* 1.mem$$scale */ == /* 0.mem$$scale */ inst0->_opnds[1]->scale()) &&
130 (inst1->_opnds[1]->disp(ra_,inst1,inst1_idx1) /* 1.mem$$disp */ == /* 0.mem$$disp */ inst0->_opnds[1]->disp(ra_,inst0,inst0_idx1))
131)
132;
133 // IF instructions and constraints matched
134 if( matches ) {
135 // generate the new sub-tree
136 assert( true, "Debug stopping point")do { if (!(true)) { (*g_assert_poison) = 'X';; report_vm_error
("ad_x86_peephole.cpp", 135, "assert(" "true" ") failed", "Debug stopping point"
); ::breakpoint(); } } while (0)
;
137 storeLNode *root = new storeLNode();
138 // ----- Initial setup -----
139 root->add_req(_in[0]); // control edge
140 root->add_req(inst1->in(1)); // unmatched ideal edge
141 root->_bottom_type = inst1->bottom_type();
142 ra_->add_reference(root, inst1);
143 ra_->set_oop (root, ra_->is_oop(inst1));
144 ra_->set_pair(root->_idx, ra_->get_reg_second(inst1), ra_->get_reg_first(inst1));
145 root->_opnds[0] = inst1->_opnds[0]->clone(); // result
146 // ----- Done with initial setup -----
147 for( unsigned x1 = inst1_idx1; x1 < inst1_idx2; x1++ )
148 root->add_req( inst1->in(x1) );
149 root->_opnds[1] = inst1->_opnds[1]->clone();
150 for( unsigned x2 = inst1_idx2; x2 < inst1_idx3; x2++ )
151 root->add_req( inst1->in(x2) );
152 root->_opnds[2] = inst1->_opnds[2]->clone();
153 inst0->set_removed();
154 inst1->set_removed();
155 deleted = 2;
156 return root; // return new root;
157 }
158 }
159 } // end of peephole rule #1
160
161 return NULL__null; // No peephole rules matched
162}
163
164// Check consistency of C++ compilation with ADLC options:
165// Check adlc -DLINUX=1
166#ifndef LINUX1
167# error "LINUX must be defined"
168#endif // LINUX
169// Check adlc -D_GNU_SOURCE=1
170#ifndef _GNU_SOURCE1
171# error "_GNU_SOURCE must be defined"
172#endif // _GNU_SOURCE
173// Check adlc -DAMD64=1
174#ifndef AMD641
175# error "AMD64 must be defined"
176#endif // AMD64
177// Check adlc -D_LP64=1
178#ifndef _LP641
179# error "_LP64 must be defined"
180#endif // _LP64